/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    ap-northeast-2-pop = 'foas.ap-northeast-1.aliyuncs.com',
    ap-south-1 = 'foas.ap-northeast-1.aliyuncs.com',
    ap-southeast-2 = 'foas.ap-northeast-1.aliyuncs.com',
    ap-southeast-5 = 'foas.ap-northeast-1.aliyuncs.com',
    cn-beijing-finance-1 = 'foas.aliyuncs.com',
    cn-beijing-finance-pop = 'foas.aliyuncs.com',
    cn-beijing-gov-1 = 'foas.aliyuncs.com',
    cn-beijing-nu16-b01 = 'foas.aliyuncs.com',
    cn-chengdu = 'foas.aliyuncs.com',
    cn-edge-1 = 'foas.aliyuncs.com',
    cn-fujian = 'foas.aliyuncs.com',
    cn-haidian-cm12-c01 = 'foas.aliyuncs.com',
    cn-hangzhou-bj-b01 = 'foas.aliyuncs.com',
    cn-hangzhou-internal-prod-1 = 'foas.aliyuncs.com',
    cn-hangzhou-internal-test-1 = 'foas.aliyuncs.com',
    cn-hangzhou-internal-test-2 = 'foas.aliyuncs.com',
    cn-hangzhou-internal-test-3 = 'foas.aliyuncs.com',
    cn-hangzhou-test-306 = 'foas.aliyuncs.com',
    cn-hongkong = 'foas.aliyuncs.com',
    cn-hongkong-finance-pop = 'foas.aliyuncs.com',
    cn-huhehaote = 'foas.aliyuncs.com',
    cn-qingdao-nebula = 'foas.aliyuncs.com',
    cn-shanghai-et15-b01 = 'foas.aliyuncs.com',
    cn-shanghai-et2-b01 = 'foas.aliyuncs.com',
    cn-shanghai-inner = 'foas.aliyuncs.com',
    cn-shanghai-internal-test-1 = 'foas.aliyuncs.com',
    cn-shenzhen-finance-1 = 'foas.aliyuncs.com',
    cn-shenzhen-inner = 'foas.aliyuncs.com',
    cn-shenzhen-st4-d01 = 'foas.aliyuncs.com',
    cn-shenzhen-su18-b01 = 'foas.aliyuncs.com',
    cn-wuhan = 'foas.aliyuncs.com',
    cn-yushanfang = 'foas.aliyuncs.com',
    cn-zhangbei-na61-b01 = 'foas.aliyuncs.com',
    cn-zhangjiakou-na62-a01 = 'foas.aliyuncs.com',
    cn-zhengzhou-nebula-1 = 'foas.aliyuncs.com',
    eu-central-1 = 'foas.ap-northeast-1.aliyuncs.com',
    eu-west-1 = 'foas.ap-northeast-1.aliyuncs.com',
    eu-west-1-oxs = 'foas.ap-northeast-1.aliyuncs.com',
    me-east-1 = 'foas.ap-northeast-1.aliyuncs.com',
    rus-west-1-pop = 'foas.ap-northeast-1.aliyuncs.com',
    us-east-1 = 'foas.ap-northeast-1.aliyuncs.com',
    us-west-1 = 'foas.ap-northeast-1.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('foas', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddTaskJobHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId'),
}

model AddTaskJobRequest {
  nodeIds?: [ string ](name='nodeIds'),
}

model AddTaskJobResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AddTaskJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddTaskJobResponseBody(name='body'),
}

async function addTaskJobWithOptions(projectName: string, tasksId: string, request: AddTaskJobRequest, headers: AddTaskJobHeaders, runtime: Util.RuntimeOptions): AddTaskJobResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.nodeIds)) {
    body['nodeIds'] = request.nodeIds;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AddTaskJob',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/vvp/projects/${OpenApiUtil.getEncodeParam(projectName)}/tasks/${OpenApiUtil.getEncodeParam(tasksId)}/jobs`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addTaskJob(projectName: string, tasksId: string, request: AddTaskJobRequest): AddTaskJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new AddTaskJobHeaders{};
  return addTaskJobWithOptions(projectName, tasksId, request, headers, runtime);
}

model AddWhitelistUserHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId'),
}

model AddWhitelistUserRequest {
  remark?: string(name='remark'),
  userId?: string(name='userId'),
}

model AddWhitelistUserResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AddWhitelistUserResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddWhitelistUserResponseBody(name='body'),
}

async function addWhitelistUserWithOptions(request: AddWhitelistUserRequest, headers: AddWhitelistUserHeaders, runtime: Util.RuntimeOptions): AddWhitelistUserResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.remark)) {
    body['remark'] = request.remark;
  }
  if (!Util.isUnset(request.userId)) {
    body['userId'] = request.userId;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AddWhitelistUser',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/vvp/whitelist/add`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addWhitelistUser(request: AddWhitelistUserRequest): AddWhitelistUserResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new AddWhitelistUserHeaders{};
  return addWhitelistUserWithOptions(request, headers, runtime);
}

model BatchGetInstanceRunSummaryHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou-pre'),
}

model BatchGetInstanceRunSummaryRequest {
  jobNames?: string(name='jobNames', example='job1,job2'),
  jobType?: string(name='jobType', example='FLINK_STREAM'),
}

model BatchGetInstanceRunSummaryResponseBody = {
  requestId?: string(name='RequestId', example='FD0FF8C0-779A-45EB-9674-FF3E127B10D2'),
  runSummarys?: {
    runSummary?: [ 
    {
      actualState?: string(name='ActualState', example='RUNNING'),
      engineJobHandler?: string(name='EngineJobHandler', example='aplication_x | xxxxx'),
      expectState?: string(name='ExpectState', example='RUNNIBG'),
      id?: long(name='Id', example='1'),
      inputDelay?: long(name='InputDelay', example='300'),
      jobName?: string(name='JobName', example='job1，job2'),
      lastErrorMessage?: string(name='LastErrorMessage', example='error'),
      lastErrorTime?: long(name='LastErrorTime', example='1548397575000'),
    }
  ](name='RunSummary')
  }(name='RunSummarys'),
}

model BatchGetInstanceRunSummaryResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: BatchGetInstanceRunSummaryResponseBody(name='body'),
}

async function batchGetInstanceRunSummaryWithOptions(projectName: string, request: BatchGetInstanceRunSummaryRequest, headers: BatchGetInstanceRunSummaryHeaders, runtime: Util.RuntimeOptions): BatchGetInstanceRunSummaryResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.jobNames)) {
    query['jobNames'] = request.jobNames;
  }
  if (!Util.isUnset(request.jobType)) {
    query['jobType'] = request.jobType;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BatchGetInstanceRunSummary',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/runsummary`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function batchGetInstanceRunSummary(projectName: string, request: BatchGetInstanceRunSummaryRequest): BatchGetInstanceRunSummaryResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new BatchGetInstanceRunSummaryHeaders{};
  return batchGetInstanceRunSummaryWithOptions(projectName, request, headers, runtime);
}

model BindQueueHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model BindQueueRequest {
  clusterId?: string(name='clusterId', example='d6wxwo5tnrmuamx2ly3m****'),
  queueName?: string(name='queueName', example='queue1'),
}

model BindQueueResponseBody = {
  requestId?: string(name='RequestId', example='C5C6746D-2FFC-4D5D-A6A8-FA8DF7585DC2'),
}

model BindQueueResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: BindQueueResponseBody(name='body'),
}

async function bindQueueWithOptions(projectName: string, request: BindQueueRequest, headers: BindQueueHeaders, runtime: Util.RuntimeOptions): BindQueueResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clusterId)) {
    body['clusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.queueName)) {
    body['queueName'] = request.queueName;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'BindQueue',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/queue`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function bindQueue(projectName: string, request: BindQueueRequest): BindQueueResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new BindQueueHeaders{};
  return bindQueueWithOptions(projectName, request, headers, runtime);
}

model CalcPlanJsonResourceHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-shanghai'),
}

model CalcPlanJsonResourceResponseBody = {
  planJsonResource?: {
    cores?: float(name='Cores', example='1.2'),
    memoryGB?: float(name='MemoryGB', example='3'),
  }(name='PlanJsonResource'),
  requestId?: string(name='RequestId', example='FD0FF8C0-779A-45EB-9674-FF3E127B10D2'),
}

model CalcPlanJsonResourceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CalcPlanJsonResourceResponseBody(name='body'),
}

async function calcPlanJsonResourceWithOptions(projectName: string, jobName: string, headers: CalcPlanJsonResourceHeaders, runtime: Util.RuntimeOptions): CalcPlanJsonResourceResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'CalcPlanJsonResource',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}/planjson-resource`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function calcPlanJsonResource(projectName: string, jobName: string): CalcPlanJsonResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new CalcPlanJsonResourceHeaders{};
  return calcPlanJsonResourceWithOptions(projectName, jobName, headers, runtime);
}

model CheckRawPlanJsonHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou-pre'),
}

model CheckRawPlanJsonRequest {
  sessionId?: string(name='sessionId', example='j6b43mm10nnzywsixmeh8maflgt6xq5afyeuflow3fravqlby0udi605mi7sty2pem2w9nysqiztag5je4esvmgq04pdcazgdthy3u5riy6na0fz6fmgph1k6b62bvjs7kqorn69ujsk0'),
}

model CheckRawPlanJsonResponseBody = {
  planJsonInfo?: {
    errorMessage?: string(name='ErrorMessage', example='eroor'),
    planJson?: string(name='PlanJson', example='{a:b}'),
    status?: string(name='Status', example='success'),
  }(name='PlanJsonInfo'),
  requestId?: string(name='RequestId', example='FD0FF8C0-779A-45EB-9674-FF3E127B10D2'),
}

model CheckRawPlanJsonResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CheckRawPlanJsonResponseBody(name='body'),
}

async function checkRawPlanJsonWithOptions(projectName: string, jobName: string, request: CheckRawPlanJsonRequest, headers: CheckRawPlanJsonHeaders, runtime: Util.RuntimeOptions): CheckRawPlanJsonResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.sessionId)) {
    query['sessionId'] = request.sessionId;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckRawPlanJson',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}/planjson/check`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function checkRawPlanJson(projectName: string, jobName: string, request: CheckRawPlanJsonRequest): CheckRawPlanJsonResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new CheckRawPlanJsonHeaders{};
  return checkRawPlanJsonWithOptions(projectName, jobName, request, headers, runtime);
}

model CommitJobHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model CommitJobRequest {
  configure?: string(name='configure', example='{"fetch_delay":1.0,"recommendOnly":true}'),
  isOnOff?: boolean(name='isOnOff', example='true'),
  maxCU?: float(name='maxCU', example='10.0'),
  recommendOnly?: boolean(name='recommendOnly', example='false'),
  suspendPeriodParam?: [ 
    {
      endTime?: string(name='endTime', example='18:25'),
      plan?: string(name='plan', example='ORIGINAL'),
      policy?: string(name='policy', example='EVERY_DAY_TIME'),
      startTime?: string(name='startTime', example='18:20'),
    }
  ](name='suspendPeriodParam'),
  suspendPeriods?: string(name='suspendPeriods', example='[{"endTime":"18:20","startTime":"18:00","plan":"ORIGINAL","policy":"EVERY_DAY_TIME"},{"endTime":"19:00","startTime":"18:40","plan":"CURRENT","policy":"EVERY_DAY_TIME"},{"endTime":"2020-07-17 20:00","startTime":"2020-07-17 19:30","plan":"CURRENT","policy":"SPECIFIED_TIME"}]'),
}

model CommitJobResponseBody = {
  requestId?: string(name='RequestId', example='C5C6746D-2FFC-4D5D-A6A8-FA8DF7585DC2'),
}

model CommitJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CommitJobResponseBody(name='body'),
}

async function commitJobWithOptions(projectName: string, jobName: string, request: CommitJobRequest, headers: CommitJobHeaders, runtime: Util.RuntimeOptions): CommitJobResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.configure)) {
    body['configure'] = request.configure;
  }
  if (!Util.isUnset(request.isOnOff)) {
    body['isOnOff'] = request.isOnOff;
  }
  if (!Util.isUnset(request.maxCU)) {
    body['maxCU'] = request.maxCU;
  }
  if (!Util.isUnset(request.recommendOnly)) {
    body['recommendOnly'] = request.recommendOnly;
  }
  if (!Util.isUnset(request.suspendPeriodParam)) {
    body['suspendPeriodParam'] = request.suspendPeriodParam;
  }
  if (!Util.isUnset(request.suspendPeriods)) {
    body['suspendPeriods'] = request.suspendPeriods;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CommitJob',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}/commit`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function commitJob(projectName: string, jobName: string, request: CommitJobRequest): CommitJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new CommitJobHeaders{};
  return commitJobWithOptions(projectName, jobName, request, headers, runtime);
}

model CreateCellClusterOrderHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-shanghai'),
}

model CreateCellClusterOrderRequest {
  masterNum?: int32(name='masterNum', example='3'),
  masterSpec?: string(name='masterSpec', example='Ecs_4c16g'),
  payModel?: string(name='payModel', example='pre'),
  period?: int32(name='period', example='8'),
  region?: string(name='region', example='cn-hangzhou'),
  slaveNum?: int32(name='slaveNum', example='3'),
  slaveSpec?: string(name='slaveSpec', example='Ecs_8c32g'),
}

model CreateCellClusterOrderResponseBody = {
  orderId?: string(name='OrderId', example='285769237053'),
  requestId?: string(name='RequestId', example='0AF4C903-5164-4128-80FC-461ADCBC2E70'),
}

model CreateCellClusterOrderResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateCellClusterOrderResponseBody(name='body'),
}

async function createCellClusterOrderWithOptions(request: CreateCellClusterOrderRequest, headers: CreateCellClusterOrderHeaders, runtime: Util.RuntimeOptions): CreateCellClusterOrderResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.masterNum)) {
    body['masterNum'] = request.masterNum;
  }
  if (!Util.isUnset(request.masterSpec)) {
    body['masterSpec'] = request.masterSpec;
  }
  if (!Util.isUnset(request.payModel)) {
    body['payModel'] = request.payModel;
  }
  if (!Util.isUnset(request.period)) {
    body['period'] = request.period;
  }
  if (!Util.isUnset(request.region)) {
    body['region'] = request.region;
  }
  if (!Util.isUnset(request.slaveNum)) {
    body['slaveNum'] = request.slaveNum;
  }
  if (!Util.isUnset(request.slaveSpec)) {
    body['slaveSpec'] = request.slaveSpec;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateCellClusterOrder',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/realtime-compute/cell/buy`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createCellClusterOrder(request: CreateCellClusterOrderRequest): CreateCellClusterOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new CreateCellClusterOrderHeaders{};
  return createCellClusterOrderWithOptions(request, headers, runtime);
}

model CreateClusterHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model CreateClusterRequest {
  description?: string(name='description', example='cluster1'),
  displayName?: string(name='displayName', example='cluster_name'),
  orderId?: string(name='orderId', example='blinkonecs_1234'),
  userOssBucket?: string(name='userOssBucket', example='12345'),
  userVSwitch?: string(name='userVSwitch', example='vsw-abcde'),
  userVpcId?: string(name='userVpcId', example='vpc-abcde'),
  zoneId?: string(name='zoneId', example='cn-shanghai-f'),
}

model CreateClusterResponseBody = {
  clusterId?: string(name='ClusterId', example='cmy99ugusuco66x9qc6k****'),
  requestId?: string(name='RequestId', example='FD0FF8C0-779A-45EB-9674-FF3E127B10D2'),
}

model CreateClusterResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateClusterResponseBody(name='body'),
}

async function createClusterWithOptions(request: CreateClusterRequest, headers: CreateClusterHeaders, runtime: Util.RuntimeOptions): CreateClusterResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.displayName)) {
    body['displayName'] = request.displayName;
  }
  if (!Util.isUnset(request.orderId)) {
    body['orderId'] = request.orderId;
  }
  if (!Util.isUnset(request.userOssBucket)) {
    body['userOssBucket'] = request.userOssBucket;
  }
  if (!Util.isUnset(request.userVSwitch)) {
    body['userVSwitch'] = request.userVSwitch;
  }
  if (!Util.isUnset(request.userVpcId)) {
    body['userVpcId'] = request.userVpcId;
  }
  if (!Util.isUnset(request.zoneId)) {
    body['zoneId'] = request.zoneId;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateCluster',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/clusters`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createCluster(request: CreateClusterRequest): CreateClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new CreateClusterHeaders{};
  return createClusterWithOptions(request, headers, runtime);
}

model CreateFolderHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model CreateFolderRequest {
  path?: string(name='path', example='/path'),
}

model CreateFolderResponseBody = {
  folderId?: long(name='FolderId', example='33193'),
  requestId?: string(name='RequestId', example='B43F695A-F126-46C0-B336-846D6290474D'),
}

model CreateFolderResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateFolderResponseBody(name='body'),
}

async function createFolderWithOptions(projectName: string, request: CreateFolderRequest, headers: CreateFolderHeaders, runtime: Util.RuntimeOptions): CreateFolderResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.path)) {
    body['path'] = request.path;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateFolder',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/folders`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createFolder(projectName: string, request: CreateFolderRequest): CreateFolderResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new CreateFolderHeaders{};
  return createFolderWithOptions(projectName, request, headers, runtime);
}

model CreateJobHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId'),
}

model CreateJobRequest {
  apiType?: string(name='apiType', example='Datastream'),
  clusterId?: string(name='clusterId', example='rcmp9x37ztfb63g1x7lt****'),
  code?: string(name='code', example='blink.main.class=com.hjc.test.blink_test.ChinanTopSpeedWindowing2\\r\\nblink.job.name=datastream_prestest'),
  description?: string(name='description', example='test'),
  engineVersion?: string(name='engineVersion', example='blink_2.2.4'),
  folderId?: long(name='folderId', example='123'),
  jobName?: string(name='jobName', example='job1'),
  jobType?: string(name='jobType', example='FLINK_STREAM'),
  packages?: string(name='packages', example='package1,package2'),
  planJson?: string(name='planJson', example='{a:b}'),
  properties?: string(name='properties', example='{k:v}'),
  queueName?: string(name='queueName', example='root.default'),
}

model CreateJobResponseBody = {
  requestId?: string(name='RequestId', example='B661F03F-0F9D-4EFF-A40F-4ED1519A549A'),
}

model CreateJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateJobResponseBody(name='body'),
}

async function createJobWithOptions(projectName: string, request: CreateJobRequest, headers: CreateJobHeaders, runtime: Util.RuntimeOptions): CreateJobResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.apiType)) {
    body['apiType'] = request.apiType;
  }
  if (!Util.isUnset(request.clusterId)) {
    body['clusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.code)) {
    body['code'] = request.code;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.engineVersion)) {
    body['engineVersion'] = request.engineVersion;
  }
  if (!Util.isUnset(request.folderId)) {
    body['folderId'] = request.folderId;
  }
  if (!Util.isUnset(request.jobName)) {
    body['jobName'] = request.jobName;
  }
  if (!Util.isUnset(request.jobType)) {
    body['jobType'] = request.jobType;
  }
  if (!Util.isUnset(request.packages)) {
    body['packages'] = request.packages;
  }
  if (!Util.isUnset(request.planJson)) {
    body['planJson'] = request.planJson;
  }
  if (!Util.isUnset(request.properties)) {
    body['properties'] = request.properties;
  }
  if (!Util.isUnset(request.queueName)) {
    body['queueName'] = request.queueName;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateJob',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createJob(projectName: string, request: CreateJobRequest): CreateJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new CreateJobHeaders{};
  return createJobWithOptions(projectName, request, headers, runtime);
}

model CreatePackageHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model CreatePackageRequest {
  description?: string(name='description', example='test'),
  md5?: string(name='md5', example='3F7468C153E529B141C326332DF15D05'),
  originName?: string(name='originName', example='12222'),
  ossBucket?: string(name='ossBucket', description='OSSBucket', example='blinktest2.oss-cn-hangzhou-internal.aliyuncs.com'),
  ossEndpoint?: string(name='ossEndpoint', example='oss-cn-hangzhou-internal.aliyuncs.com'),
  ossOwner?: string(name='ossOwner', example='user1'),
  ossPath?: string(name='ossPath', example='path1/path2/a.jar'),
  packageName?: string(name='packageName', example='package1.jar'),
  tag?: string(name='tag', example='{"function":"group by time"}'),
  type?: string(name='type', example='JAR'),
}

model CreatePackageResponseBody = {
  requestId?: string(name='RequestId', example='F85A9751-638B-4186-B5E5-3F66D8A1CBFE'),
}

model CreatePackageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreatePackageResponseBody(name='body'),
}

async function createPackageWithOptions(projectName: string, request: CreatePackageRequest, headers: CreatePackageHeaders, runtime: Util.RuntimeOptions): CreatePackageResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.md5)) {
    body['md5'] = request.md5;
  }
  if (!Util.isUnset(request.originName)) {
    body['originName'] = request.originName;
  }
  if (!Util.isUnset(request.ossBucket)) {
    body['ossBucket'] = request.ossBucket;
  }
  if (!Util.isUnset(request.ossEndpoint)) {
    body['ossEndpoint'] = request.ossEndpoint;
  }
  if (!Util.isUnset(request.ossOwner)) {
    body['ossOwner'] = request.ossOwner;
  }
  if (!Util.isUnset(request.ossPath)) {
    body['ossPath'] = request.ossPath;
  }
  if (!Util.isUnset(request.packageName)) {
    body['packageName'] = request.packageName;
  }
  if (!Util.isUnset(request.tag)) {
    body['tag'] = request.tag;
  }
  if (!Util.isUnset(request.type)) {
    body['type'] = request.type;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreatePackage',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/packages`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createPackage(projectName: string, request: CreatePackageRequest): CreatePackageResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new CreatePackageHeaders{};
  return createPackageWithOptions(projectName, request, headers, runtime);
}

model CreateProjectHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId'),
}

model CreateProjectRequest {
  clusterId?: string(name='clusterId', example='cmy99ugusuco66x9qc6k****'),
  deployType?: string(name='deployType', example='public'),
  description?: string(name='description'),
  managerIds?: string(name='managerIds', example='1234567'),
  name?: string(name='name', example='project1'),
  orderId?: string(name='orderId', example='stream-abcd'),
}

model CreateProjectResponseBody = {
  requestId?: string(name='RequestId', example='B661F03F-0F9D-4EFF-A40F-4ED1519A549A'),
}

model CreateProjectResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateProjectResponseBody(name='body'),
}

async function createProjectWithOptions(request: CreateProjectRequest, headers: CreateProjectHeaders, runtime: Util.RuntimeOptions): CreateProjectResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clusterId)) {
    body['clusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.deployType)) {
    body['deployType'] = request.deployType;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.managerIds)) {
    body['managerIds'] = request.managerIds;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.orderId)) {
    body['orderId'] = request.orderId;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateProject',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createProject(request: CreateProjectRequest): CreateProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new CreateProjectHeaders{};
  return createProjectWithOptions(request, headers, runtime);
}

model CreateQueueHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-shanghai'),
}

model CreateQueueRequest {
  gpu?: int32(name='gpu', example='1'),
  maxMemMB?: int32(name='maxMemMB', example='16'),
  maxVcore?: int32(name='maxVcore', example='4'),
  queueName?: string(name='queueName', example='root.default'),
}

model CreateQueueResponseBody = {
  requestId?: string(name='RequestId', example='9F1CAD8D-E80E-45AF-82D7-8314FE17A34A'),
}

model CreateQueueResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateQueueResponseBody(name='body'),
}

async function createQueueWithOptions(clusterId: string, request: CreateQueueRequest, headers: CreateQueueHeaders, runtime: Util.RuntimeOptions): CreateQueueResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.gpu)) {
    body['gpu'] = request.gpu;
  }
  if (!Util.isUnset(request.maxMemMB)) {
    body['maxMemMB'] = request.maxMemMB;
  }
  if (!Util.isUnset(request.maxVcore)) {
    body['maxVcore'] = request.maxVcore;
  }
  if (!Util.isUnset(request.queueName)) {
    body['queueName'] = request.queueName;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateQueue',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/clusters/${OpenApiUtil.getEncodeParam(clusterId)}/queue`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createQueue(clusterId: string, request: CreateQueueRequest): CreateQueueResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new CreateQueueHeaders{};
  return createQueueWithOptions(clusterId, request, headers, runtime);
}

model CreateTaskHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId'),
}

model CreateTaskRequest {
  name?: string(name='name'),
  targetNamespace?: string(name='targetNamespace'),
  targetUserId?: string(name='targetUserId'),
  targetWorkspace?: string(name='targetWorkspace'),
  transferType?: int32(name='transferType'),
}

model CreateTaskResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  task?: {
    creator?: string(name='Creator'),
    gmtCreate?: long(name='GmtCreate'),
    gmtModified?: long(name='GmtModified'),
    id?: long(name='Id'),
    modifier?: string(name='Modifier'),
    name?: string(name='Name'),
    seizeHost?: string(name='SeizeHost'),
    srcProjectGlobalConfig?: string(name='SrcProjectGlobalConfig'),
    srcProjectId?: string(name='SrcProjectId'),
    srcProjectName?: string(name='SrcProjectName'),
    state?: string(name='State'),
    targetNamespace?: string(name='TargetNamespace'),
    targetUserId?: string(name='TargetUserId'),
    targetWorkspace?: string(name='TargetWorkspace'),
    transferType?: int32(name='TransferType'),
  }(name='Task'),
}

model CreateTaskResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateTaskResponseBody(name='body'),
}

async function createTaskWithOptions(projectName: string, request: CreateTaskRequest, headers: CreateTaskHeaders, runtime: Util.RuntimeOptions): CreateTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.targetNamespace)) {
    body['targetNamespace'] = request.targetNamespace;
  }
  if (!Util.isUnset(request.targetUserId)) {
    body['targetUserId'] = request.targetUserId;
  }
  if (!Util.isUnset(request.targetWorkspace)) {
    body['targetWorkspace'] = request.targetWorkspace;
  }
  if (!Util.isUnset(request.transferType)) {
    body['transferType'] = request.transferType;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateTask',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/vvp/projects/${OpenApiUtil.getEncodeParam(projectName)}/tasks`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createTask(projectName: string, request: CreateTaskRequest): CreateTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new CreateTaskHeaders{};
  return createTaskWithOptions(projectName, request, headers, runtime);
}

model DeleteFolderHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DeleteFolderRequest {
  path?: string(name='path', example='/path1/path2'),
}

model DeleteFolderResponseBody = {
  requestId?: string(name='RequestId', example='C5C6746D-2FFC-4D5D-A6A8-FA8DF7585DC2'),
}

model DeleteFolderResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteFolderResponseBody(name='body'),
}

async function deleteFolderWithOptions(projectName: string, request: DeleteFolderRequest, headers: DeleteFolderHeaders, runtime: Util.RuntimeOptions): DeleteFolderResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.path)) {
    query['path'] = request.path;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteFolder',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/folders`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteFolder(projectName: string, request: DeleteFolderRequest): DeleteFolderResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new DeleteFolderHeaders{};
  return deleteFolderWithOptions(projectName, request, headers, runtime);
}

model DeleteJobHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DeleteJobResponseBody = {
  requestId?: string(name='RequestId', example='78261AC6-B5C9-4514-B82F-39BCC45A5D63'),
}

model DeleteJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteJobResponseBody(name='body'),
}

async function deleteJobWithOptions(projectName: string, jobName: string, headers: DeleteJobHeaders, runtime: Util.RuntimeOptions): DeleteJobResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'DeleteJob',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteJob(projectName: string, jobName: string): DeleteJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new DeleteJobHeaders{};
  return deleteJobWithOptions(projectName, jobName, headers, runtime);
}

model DeletePackageHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DeletePackageResponseBody = {
  requestId?: string(name='RequestId', example='A604B9FA-D181-43D7-A064-5FF971B90466'),
}

model DeletePackageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeletePackageResponseBody(name='body'),
}

async function deletePackageWithOptions(projectName: string, packageName: string, headers: DeletePackageHeaders, runtime: Util.RuntimeOptions): DeletePackageResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'DeletePackage',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/packages/${OpenApiUtil.getEncodeParam(packageName)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deletePackage(projectName: string, packageName: string): DeletePackageResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new DeletePackageHeaders{};
  return deletePackageWithOptions(projectName, packageName, headers, runtime);
}

model DeleteProjectHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DeleteProjectResponseBody = {
  requestId?: string(name='RequestId', example='3F4ADBCF-B116-4680-80B3-E9A139841A0D'),
}

model DeleteProjectResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteProjectResponseBody(name='body'),
}

async function deleteProjectWithOptions(projectName: string, headers: DeleteProjectHeaders, runtime: Util.RuntimeOptions): DeleteProjectResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'DeleteProject',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteProject(projectName: string): DeleteProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new DeleteProjectHeaders{};
  return deleteProjectWithOptions(projectName, headers, runtime);
}

model DeleteQueueHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DeleteQueueRequest {
  queueName?: string(name='queueName', example='root.default'),
}

model DeleteQueueResponseBody = {
  requestId?: string(name='RequestId', example='C5C6746D-2FFC-4D5D-A6A8-FA8DF7585DC2'),
}

model DeleteQueueResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteQueueResponseBody(name='body'),
}

async function deleteQueueWithOptions(clusterId: string, request: DeleteQueueRequest, headers: DeleteQueueHeaders, runtime: Util.RuntimeOptions): DeleteQueueResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.queueName)) {
    query['queueName'] = request.queueName;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteQueue',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/clusters/${OpenApiUtil.getEncodeParam(clusterId)}/queue`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteQueue(clusterId: string, request: DeleteQueueRequest): DeleteQueueResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new DeleteQueueHeaders{};
  return deleteQueueWithOptions(clusterId, request, headers, runtime);
}

model DeleteTaskJobHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId'),
}

model DeleteTaskJobRequest {
  jobIds?: [ long ](name='jobIds'),
}

model DeleteTaskJobShrinkRequest {
  jobIdsShrink?: string(name='jobIds'),
}

model DeleteTaskJobResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteTaskJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteTaskJobResponseBody(name='body'),
}

async function deleteTaskJobWithOptions(projectName: string, tasksId: string, tmpReq: DeleteTaskJobRequest, headers: DeleteTaskJobHeaders, runtime: Util.RuntimeOptions): DeleteTaskJobResponse {
  Util.validateModel(tmpReq);
  var request = new DeleteTaskJobShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.jobIds)) {
    request.jobIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.jobIds, 'jobIds', 'simple');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.jobIdsShrink)) {
    query['jobIds'] = request.jobIdsShrink;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteTaskJob',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/vvp/projects/${OpenApiUtil.getEncodeParam(projectName)}/tasks/${OpenApiUtil.getEncodeParam(tasksId)}/jobs`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteTaskJob(projectName: string, tasksId: string, request: DeleteTaskJobRequest): DeleteTaskJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new DeleteTaskJobHeaders{};
  return deleteTaskJobWithOptions(projectName, tasksId, request, headers, runtime);
}

model DeleteWhitelistUserHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId'),
}

model DeleteWhitelistUserRequest {
  userId?: string(name='userId'),
}

model DeleteWhitelistUserResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteWhitelistUserResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteWhitelistUserResponseBody(name='body'),
}

async function deleteWhitelistUserWithOptions(request: DeleteWhitelistUserRequest, headers: DeleteWhitelistUserHeaders, runtime: Util.RuntimeOptions): DeleteWhitelistUserResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.userId)) {
    query['userId'] = request.userId;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteWhitelistUser',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/vvp/whitelist/delete`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteWhitelistUser(request: DeleteWhitelistUserRequest): DeleteWhitelistUserResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new DeleteWhitelistUserHeaders{};
  return deleteWhitelistUserWithOptions(request, headers, runtime);
}

model DestroyClusterHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DestroyClusterResponseBody = {
  requestId?: string(name='RequestId', example='C5C6746D-2FFC-4D5D-A6A8-FA8DF7585DC2'),
}

model DestroyClusterResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DestroyClusterResponseBody(name='body'),
}

async function destroyClusterWithOptions(clusterId: string, headers: DestroyClusterHeaders, runtime: Util.RuntimeOptions): DestroyClusterResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'DestroyCluster',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/clusters/${OpenApiUtil.getEncodeParam(clusterId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function destroyCluster(clusterId: string): DestroyClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new DestroyClusterHeaders{};
  return destroyClusterWithOptions(clusterId, headers, runtime);
}

model ExpandClusterHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model ExpandClusterRequest {
  count?: int32(name='count', example='5'),
  model?: string(name='model', example='Ecs_4c16g'),
  userVSwitch?: string(name='userVSwitch', example='vsw-abcd'),
}

model ExpandClusterResponseBody = {
  requestId?: string(name='RequestId', example='C5C6746D-2FFC-4D5D-A6A8-FA8DF7585DC2'),
}

model ExpandClusterResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ExpandClusterResponseBody(name='body'),
}

async function expandClusterWithOptions(clusterId: string, request: ExpandClusterRequest, headers: ExpandClusterHeaders, runtime: Util.RuntimeOptions): ExpandClusterResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.count)) {
    body['count'] = request.count;
  }
  if (!Util.isUnset(request.model)) {
    body['model'] = request.model;
  }
  if (!Util.isUnset(request.userVSwitch)) {
    body['userVSwitch'] = request.userVSwitch;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExpandCluster',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/clusters/${OpenApiUtil.getEncodeParam(clusterId)}/expand`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function expandCluster(clusterId: string, request: ExpandClusterRequest): ExpandClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ExpandClusterHeaders{};
  return expandClusterWithOptions(clusterId, request, headers, runtime);
}

model GetClusterDetailsHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model GetClusterDetailsResponseBody = {
  details?: {
    clusterId?: string(name='ClusterId', example='7cmedvslzs8q9n7pkfx5****'),
    description?: string(name='Description', example='test'),
    displayName?: string(name='DisplayName', example='test'),
    gmtCreate?: long(name='GmtCreate', example='1612693397000'),
    gmtModified?: long(name='GmtModified', example='1612693397000'),
    instanceInfos?: string(name='InstanceInfos', example='{k:v}'),
    isMixDeploy?: boolean(name='IsMixDeploy', example='false'),
    operator?: string(name='Operator', example='137677185440****'),
    ownerId?: string(name='OwnerId', example='137677185440****'),
    regionId?: string(name='RegionId', example='cn-shanghai'),
    state?: string(name='State', example='STARTING'),
    storageType?: string(name='StorageType', example='HDFS'),
    userOssInfo?: string(name='UserOssInfo', example='{\\"endpoint\\":\\"oss-cn-shanghai.aliyuncs.com\\",\\"vpcEndpoint\\":\\"oss-cn-shanghai-internal.aliyuncs.com\\",\\"oxsEndpoint\\":\\"oss-cn-shanghai-internal.aliyuncs.com\\",\\"accessId\\":null,\\"accessKey\\":null,\\"bucket\\":\\"flink-test-oss-beijing\\"}'),
    userSGId?: string(name='UserSGId', example='sg-abcd'),
    userVSwitchList?: string(name='UserVSwitchList', example='[\\"vsw-uf6v128q9khll8e9ucyhj\\"]'),
    userVpcId?: string(name='UserVpcId', description='VPC ID。', example='vpc-uf6aq156h1gy06dzf****'),
    zoneId?: string(name='ZoneId', example='cn-shanghai-f'),
  }(name='Details'),
  requestId?: string(name='RequestId', example='A35C7747-AE0B-4688-AD84-82CAAD512FD3'),
}

model GetClusterDetailsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetClusterDetailsResponseBody(name='body'),
}

async function getClusterDetailsWithOptions(clusterId: string, headers: GetClusterDetailsHeaders, runtime: Util.RuntimeOptions): GetClusterDetailsResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'GetClusterDetails',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/clusters/${OpenApiUtil.getEncodeParam(clusterId)}/details`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getClusterDetails(clusterId: string): GetClusterDetailsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new GetClusterDetailsHeaders{};
  return getClusterDetailsWithOptions(clusterId, headers, runtime);
}

model GetClusterEngineVersionsHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model GetClusterEngineVersionsResponseBody = {
  engineVersions?: {
    engineVersion?: [ string ](name='EngineVersion')
  }(name='EngineVersions'),
  requestId?: string(name='RequestId', example='7203295B-3726-4BEF-B3E1-9EE33BF2FECF'),
}

model GetClusterEngineVersionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetClusterEngineVersionsResponseBody(name='body'),
}

async function getClusterEngineVersionsWithOptions(clusterId: string, headers: GetClusterEngineVersionsHeaders, runtime: Util.RuntimeOptions): GetClusterEngineVersionsResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'GetClusterEngineVersions',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/clusters/${OpenApiUtil.getEncodeParam(clusterId)}/engineversions`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getClusterEngineVersions(clusterId: string): GetClusterEngineVersionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new GetClusterEngineVersionsHeaders{};
  return getClusterEngineVersionsWithOptions(clusterId, headers, runtime);
}

model GetClusterMetricsHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model GetClusterMetricsRequest {
  metricJson?: string(name='metricJson', example='{ "end":1606291550061, "limit":"avg:sample:50", "queries":[ { "aggregator":"avg", "downsample":"avg", "granularity":"60s", "metric":"ClusterID.system.cpu.user" } ], "start":1606291390000 }'),
}

model GetClusterMetricsResponseBody = {
  metrics?: {
    metric?: [ 
    {
      dps?: map[string]any(name='Dps', example='k:v'),
      metricName?: string(name='MetricName', example='delay'),
      summary?: float(name='Summary', example='10.2'),
      tags?: map[string]any(name='Tags', example='k:v'),
    }
  ](name='Metric')
  }(name='Metrics'),
  requestId?: string(name='RequestId', example='FD0FF8C0-779A-45EB-9674-FF3E127B10D2'),
}

model GetClusterMetricsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetClusterMetricsResponseBody(name='body'),
}

async function getClusterMetricsWithOptions(clusterId: string, request: GetClusterMetricsRequest, headers: GetClusterMetricsHeaders, runtime: Util.RuntimeOptions): GetClusterMetricsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.metricJson)) {
    body['metricJson'] = request.metricJson;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetClusterMetrics',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/clusters/${OpenApiUtil.getEncodeParam(clusterId)}/metrics`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getClusterMetrics(clusterId: string, request: GetClusterMetricsRequest): GetClusterMetricsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new GetClusterMetricsHeaders{};
  return getClusterMetricsWithOptions(clusterId, request, headers, runtime);
}

model GetClusterQueueInfoHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model GetClusterQueueInfoResponseBody = {
  queues?: {
    queue?: [ 
    {
      clusterId?: string(name='ClusterId', example='h6272cj4etgqe7oets4s****'),
      externalInfo?: string(name='ExternalInfo', example='{\\"minGpu\\":0,\\"maxGpu\\":0,\\"name\\":\\"root.cloudpay_dev\\",\\"minMem\\":24535,\\"usedVCore\\":50,\\"usedGpu\\":0,\\"usedMem\\":2816,\\"minVCore\\":599,\\"maxVCore\\":600,\\"maxMem\\":24576}'),
      maxGpu?: int32(name='MaxGpu', example='0'),
      maxMem?: int32(name='MaxMem', example='24576'),
      maxVCore?: int32(name='MaxVCore', example='599'),
      minGpu?: int32(name='MinGpu', example='0'),
      minMem?: int32(name='MinMem', example='24535'),
      minVCore?: int32(name='MinVCore', example='599'),
      queueName?: string(name='QueueName', example='root.cloudpay_dev'),
      usedGpu?: int32(name='UsedGpu', example='0'),
      usedMem?: int32(name='UsedMem', example='2816'),
      usedVCore?: int32(name='UsedVCore', example='50'),
    }
  ](name='Queue')
  }(name='Queues'),
  requestId?: string(name='RequestId', example='DACD3B42-5977-4293-B5A8-197A33A954BB'),
}

model GetClusterQueueInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetClusterQueueInfoResponseBody(name='body'),
}

async function getClusterQueueInfoWithOptions(clusterId: string, headers: GetClusterQueueInfoHeaders, runtime: Util.RuntimeOptions): GetClusterQueueInfoResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'GetClusterQueueInfo',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/clusters/${OpenApiUtil.getEncodeParam(clusterId)}/queueinfo`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getClusterQueueInfo(clusterId: string): GetClusterQueueInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new GetClusterQueueInfoHeaders{};
  return getClusterQueueInfoWithOptions(clusterId, headers, runtime);
}

model GetClusterResourceHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model GetClusterResourceResponseBody = {
  requestId?: string(name='RequestId', example='1F721BC4-6298-42BB-9289-794E7B0349B9'),
  resource?: {
    allocatedMB?: long(name='AllocatedMB', example='10496'),
    allocatedVirtualCores?: long(name='AllocatedVirtualCores', example='250'),
    availableMB?: long(name='AvailableMB', example='14080'),
    availableVirtualCores?: long(name='AvailableVirtualCores', example='350'),
    totalMB?: long(name='TotalMB', example='24576'),
    totalVirtualCores?: long(name='TotalVirtualCores', example='600'),
  }(name='Resource'),
}

model GetClusterResourceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetClusterResourceResponseBody(name='body'),
}

async function getClusterResourceWithOptions(clusterId: string, headers: GetClusterResourceHeaders, runtime: Util.RuntimeOptions): GetClusterResourceResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'GetClusterResource',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/clusters/${OpenApiUtil.getEncodeParam(clusterId)}/resource`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getClusterResource(clusterId: string): GetClusterResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new GetClusterResourceHeaders{};
  return getClusterResourceWithOptions(clusterId, headers, runtime);
}

model GetFolderHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model GetFolderRequest {
  path?: string(name='path', example='/path1'),
}

model GetFolderResponseBody = {
  folder?: {
    folderId?: long(name='FolderId', example='27552'),
    path?: string(name='Path', example='/path1'),
  }(name='Folder'),
  requestId?: string(name='RequestId', example='AFD7EF32-88FA-4539-A83C-EF91DDFA2C96'),
}

model GetFolderResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetFolderResponseBody(name='body'),
}

async function getFolderWithOptions(projectName: string, request: GetFolderRequest, headers: GetFolderHeaders, runtime: Util.RuntimeOptions): GetFolderResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.path)) {
    query['path'] = request.path;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetFolder',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/folders`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getFolder(projectName: string, request: GetFolderRequest): GetFolderResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new GetFolderHeaders{};
  return getFolderWithOptions(projectName, request, headers, runtime);
}

model GetInstanceHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou-pre'),
}

model GetInstanceResponseBody = {
  instance?: {
    actualState?: string(name='ActualState', example='RUNNING'),
    apiType?: string(name='ApiType', example='DATASTREAM'),
    autoScaleParams?: string(name='AutoScaleParams', example='"{\\"isOnOff\\":false,\\"strategyConfigure\\":null,\\"maxCU\\":null}'),
    clusterId?: string(name='ClusterId', example='rcmp9x37ztfb63g1x7lt****'),
    code?: string(name='Code'),
    endTime?: long(name='EndTime', example='1548397575000'),
    engineJobHandler?: string(name='EngineJobHandler', example='application_1597654819348_****|405a6d40d7f4f2618ed532359887****'),
    engineVersion?: string(name='EngineVersion', example='blink-3.4.4'),
    expectState?: string(name='ExpectState', example='RUNNING'),
    id?: long(name='Id', description='InstanceID', example='412536'),
    inputDelay?: long(name='InputDelay', example='-99999999'),
    jobName?: string(name='JobName', example='job1'),
    jobType?: string(name='JobType', example='FLINK_STREAM'),
    lastErrorMessage?: string(name='LastErrorMessage', example='error'),
    lastErrorTime?: long(name='LastErrorTime', example='1548397575000'),
    lastOperateTime?: long(name='LastOperateTime', example='1599794334000'),
    lastOperator?: string(name='LastOperator', example='239960377092765296'),
    packages?: string(name='Packages', example='hbase_demo-1.0-snapshot-shaded.jar'),
    planJson?: string(name='PlanJson', example='{a:b}'),
    priority?: int32(name='Priority'),
    projectName?: string(name='ProjectName', example='project1'),
    properties?: string(name='Properties'),
    queueName?: string(name='QueueName', example='root.project1'),
    startTime?: long(name='StartTime', example='1599794335000'),
    starter?: string(name='Starter', example='239960377092765296'),
  }(name='Instance'),
  requestId?: string(name='RequestId', example='B2F5A5C5-5CCC-45C8-B884-7152CC345EFA'),
}

model GetInstanceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetInstanceResponseBody(name='body'),
}

async function getInstanceWithOptions(projectName: string, jobName: string, instanceId: string, headers: GetInstanceHeaders, runtime: Util.RuntimeOptions): GetInstanceResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'GetInstance',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}/instances/${OpenApiUtil.getEncodeParam(instanceId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getInstance(projectName: string, jobName: string, instanceId: string): GetInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new GetInstanceHeaders{};
  return getInstanceWithOptions(projectName, jobName, instanceId, headers, runtime);
}

model GetInstanceCheckpointHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou-pre'),
}

model GetInstanceCheckpointResponseBody = {
  checkpoints?: string(name='Checkpoints', example='{a:b}'),
  requestId?: string(name='RequestId', example='FD0FF8C0-779A-45EB-9674-FF3E127B10D2'),
}

model GetInstanceCheckpointResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetInstanceCheckpointResponseBody(name='body'),
}

async function getInstanceCheckpointWithOptions(projectName: string, jobName: string, instanceId: string, headers: GetInstanceCheckpointHeaders, runtime: Util.RuntimeOptions): GetInstanceCheckpointResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'GetInstanceCheckpoint',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}/instances/${OpenApiUtil.getEncodeParam(instanceId)}/checkpoints`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getInstanceCheckpoint(projectName: string, jobName: string, instanceId: string): GetInstanceCheckpointResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new GetInstanceCheckpointHeaders{};
  return getInstanceCheckpointWithOptions(projectName, jobName, instanceId, headers, runtime);
}

model GetInstanceConfigHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou-pre'),
}

model GetInstanceConfigResponseBody = {
  config?: string(name='Config', example='{a:b}'),
  requestId?: string(name='RequestId', example='FD0FF8C0-779A-45EB-9674-FF3E127B10D2'),
}

model GetInstanceConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetInstanceConfigResponseBody(name='body'),
}

async function getInstanceConfigWithOptions(projectName: string, jobName: string, instanceId: string, headers: GetInstanceConfigHeaders, runtime: Util.RuntimeOptions): GetInstanceConfigResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'GetInstanceConfig',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}/instances/${OpenApiUtil.getEncodeParam(instanceId)}/config`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getInstanceConfig(projectName: string, jobName: string, instanceId: string): GetInstanceConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new GetInstanceConfigHeaders{};
  return getInstanceConfigWithOptions(projectName, jobName, instanceId, headers, runtime);
}

model GetInstanceDetailHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou-pre'),
}

model GetInstanceDetailResponseBody = {
  detail?: string(name='Detail', example='{a:b}'),
  requestId?: string(name='RequestId', example='FD0FF8C0-779A-45EB-9674-FF3E127B10D2'),
}

model GetInstanceDetailResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetInstanceDetailResponseBody(name='body'),
}

async function getInstanceDetailWithOptions(projectName: string, jobName: string, instanceId: string, headers: GetInstanceDetailHeaders, runtime: Util.RuntimeOptions): GetInstanceDetailResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'GetInstanceDetail',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}/instances/${OpenApiUtil.getEncodeParam(instanceId)}/details`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getInstanceDetail(projectName: string, jobName: string, instanceId: string): GetInstanceDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new GetInstanceDetailHeaders{};
  return getInstanceDetailWithOptions(projectName, jobName, instanceId, headers, runtime);
}

model GetInstanceExceptionsHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou-pre'),
}

model GetInstanceExceptionsResponseBody = {
  exceptions?: string(name='Exceptions', example='xxxxerror'),
  requestId?: string(name='RequestId', example='FD0FF8C0-779A-45EB-9674-FF3E127B10D2'),
}

model GetInstanceExceptionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetInstanceExceptionsResponseBody(name='body'),
}

/**
  * **1**
  *
  * @param headers GetInstanceExceptionsHeaders
  * @param runtime runtime options for this request RuntimeOptions
  * @return GetInstanceExceptionsResponse
 */
async function getInstanceExceptionsWithOptions(projectName: string, jobName: string, instanceId: string, headers: GetInstanceExceptionsHeaders, runtime: Util.RuntimeOptions): GetInstanceExceptionsResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'GetInstanceExceptions',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}/instances/${OpenApiUtil.getEncodeParam(instanceId)}/exceptions`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * **1**
  *
  * @return GetInstanceExceptionsResponse
 */
async function getInstanceExceptions(projectName: string, jobName: string, instanceId: string): GetInstanceExceptionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new GetInstanceExceptionsHeaders{};
  return getInstanceExceptionsWithOptions(projectName, jobName, instanceId, headers, runtime);
}

model GetInstanceFinalStateHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou-pre'),
}

model GetInstanceFinalStateResponseBody = {
  finalstate?: string(name='Finalstate', example='RUNNING'),
  requestId?: string(name='RequestId', example='FD0FF8C0-779A-45EB-9674-FF3E127B10D2'),
}

model GetInstanceFinalStateResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetInstanceFinalStateResponseBody(name='body'),
}

async function getInstanceFinalStateWithOptions(projectName: string, jobName: string, instanceId: string, headers: GetInstanceFinalStateHeaders, runtime: Util.RuntimeOptions): GetInstanceFinalStateResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'GetInstanceFinalState',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}/instances/${OpenApiUtil.getEncodeParam(instanceId)}/finalstate`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getInstanceFinalState(projectName: string, jobName: string, instanceId: string): GetInstanceFinalStateResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new GetInstanceFinalStateHeaders{};
  return getInstanceFinalStateWithOptions(projectName, jobName, instanceId, headers, runtime);
}

model GetInstanceHistoryAutoScalePlanContentHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-shanghai'),
}

model GetInstanceHistoryAutoScalePlanContentRequest {
  planName?: string(name='planName', example='2018-09-18 10:10:20'),
}

model GetInstanceHistoryAutoScalePlanContentResponseBody = {
  planContent?: string(name='PlanContent', example='{k:v}'),
  requestId?: string(name='RequestId', example='6C799EEF-1DD8-4C55-961C-3B9D55A87AE6'),
}

model GetInstanceHistoryAutoScalePlanContentResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetInstanceHistoryAutoScalePlanContentResponseBody(name='body'),
}

async function getInstanceHistoryAutoScalePlanContentWithOptions(projectName: string, jobName: string, instanceId: string, request: GetInstanceHistoryAutoScalePlanContentRequest, headers: GetInstanceHistoryAutoScalePlanContentHeaders, runtime: Util.RuntimeOptions): GetInstanceHistoryAutoScalePlanContentResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.planName)) {
    query['planName'] = request.planName;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetInstanceHistoryAutoScalePlanContent',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}/instance/${OpenApiUtil.getEncodeParam(instanceId)}/autoscale/plancontent`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getInstanceHistoryAutoScalePlanContent(projectName: string, jobName: string, instanceId: string, request: GetInstanceHistoryAutoScalePlanContentRequest): GetInstanceHistoryAutoScalePlanContentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new GetInstanceHistoryAutoScalePlanContentHeaders{};
  return getInstanceHistoryAutoScalePlanContentWithOptions(projectName, jobName, instanceId, request, headers, runtime);
}

model GetInstanceHistoryAutoScalePlanListHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-shanghai'),
}

model GetInstanceHistoryAutoScalePlanListResponseBody = {
  planList?: {
    plan?: [ string ](name='Plan')
  }(name='PlanList'),
  requestId?: string(name='RequestId', example='9C010057-9F22-45DC-A415-4E4E53181E5E'),
}

model GetInstanceHistoryAutoScalePlanListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetInstanceHistoryAutoScalePlanListResponseBody(name='body'),
}

async function getInstanceHistoryAutoScalePlanListWithOptions(projectName: string, jobName: string, instanceId: string, headers: GetInstanceHistoryAutoScalePlanListHeaders, runtime: Util.RuntimeOptions): GetInstanceHistoryAutoScalePlanListResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'GetInstanceHistoryAutoScalePlanList',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}/instance/${OpenApiUtil.getEncodeParam(instanceId)}/autoscale/planlist`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getInstanceHistoryAutoScalePlanList(projectName: string, jobName: string, instanceId: string): GetInstanceHistoryAutoScalePlanListResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new GetInstanceHistoryAutoScalePlanListHeaders{};
  return getInstanceHistoryAutoScalePlanListWithOptions(projectName, jobName, instanceId, headers, runtime);
}

model GetInstanceMetricHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model GetInstanceMetricRequest {
  instanceId?: long(name='instanceId', example='-1'),
  metricJson?: string(name='metricJson', example='{"start":1606291390000,"end":1606294626216,"limit":"avg:sample:50","queries":[{"downsample":"20s-avg","metric":"blink.projectName.jobName.task_failover.rate","granularity":"20s","aggregator":"max"}]}'),
}

model GetInstanceMetricResponseBody = {
  metrics?: {
    metric?: [ 
    {
      dps?: map[string]any(name='Dps', example='k:v'),
      metricName?: string(name='MetricName', example='delay'),
      summary?: float(name='Summary', example='10.2'),
      tags?: map[string]any(name='Tags', example='k:v'),
    }
  ](name='Metric')
  }(name='Metrics'),
  requestId?: string(name='RequestId', example='FD0FF8C0-779A-45EB-9674-FF3E127B10D2'),
}

model GetInstanceMetricResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetInstanceMetricResponseBody(name='body'),
}

async function getInstanceMetricWithOptions(projectName: string, jobName: string, request: GetInstanceMetricRequest, headers: GetInstanceMetricHeaders, runtime: Util.RuntimeOptions): GetInstanceMetricResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['instanceId'] = request.instanceId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.metricJson)) {
    body['metricJson'] = request.metricJson;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetInstanceMetric',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}/metric`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getInstanceMetric(projectName: string, jobName: string, request: GetInstanceMetricRequest): GetInstanceMetricResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new GetInstanceMetricHeaders{};
  return getInstanceMetricWithOptions(projectName, jobName, request, headers, runtime);
}

model GetInstanceResourceHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou-pre'),
}

model GetInstanceResourceResponseBody = {
  requestId?: string(name='RequestId', example='FD0FF8C0-779A-45EB-9674-FF3E127B10D2'),
  resource?: {
    allocatedMB?: long(name='AllocatedMB', example='2048'),
    allocatedVirtualCores?: long(name='AllocatedVirtualCores', example='100'),
    totalMB?: long(name='TotalMB', example='1024'),
    totalVirtualCores?: long(name='TotalVirtualCores', example='50'),
  }(name='Resource'),
}

model GetInstanceResourceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetInstanceResourceResponseBody(name='body'),
}

async function getInstanceResourceWithOptions(projectName: string, jobName: string, instanceId: string, headers: GetInstanceResourceHeaders, runtime: Util.RuntimeOptions): GetInstanceResourceResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'GetInstanceResource',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}/instances/${OpenApiUtil.getEncodeParam(instanceId)}/resource`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getInstanceResource(projectName: string, jobName: string, instanceId: string): GetInstanceResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new GetInstanceResourceHeaders{};
  return getInstanceResourceWithOptions(projectName, jobName, instanceId, headers, runtime);
}

model GetInstanceRunSummaryHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou-pre'),
}

model GetInstanceRunSummaryResponseBody = {
  requestId?: string(name='RequestId', example='FD0FF8C0-779A-45EB-9674-FF3E127B10D2'),
  runSummary?: {
    actualState?: string(name='ActualState', example='RUNNING'),
    engineJobHandler?: string(name='EngineJobHandler', example='application_xxxxx | xxxxx'),
    expectState?: string(name='ExpectState', example='RUNNING'),
    id?: long(name='Id', description='InstanceID', example='123'),
    inputDelay?: long(name='InputDelay', example='20'),
    jobName?: string(name='JobName', example='job1'),
    lastErrorMessage?: string(name='LastErrorMessage', example='error'),
    lastErrorTime?: long(name='LastErrorTime', example='1548397575000'),
  }(name='RunSummary'),
}

model GetInstanceRunSummaryResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetInstanceRunSummaryResponseBody(name='body'),
}

async function getInstanceRunSummaryWithOptions(projectName: string, jobName: string, instanceId: string, headers: GetInstanceRunSummaryHeaders, runtime: Util.RuntimeOptions): GetInstanceRunSummaryResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'GetInstanceRunSummary',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}/instances/${OpenApiUtil.getEncodeParam(instanceId)}/runsummary`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getInstanceRunSummary(projectName: string, jobName: string, instanceId: string): GetInstanceRunSummaryResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new GetInstanceRunSummaryHeaders{};
  return getInstanceRunSummaryWithOptions(projectName, jobName, instanceId, headers, runtime);
}

model GetJobHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model GetJobResponseBody = {
  job?: {
    apiType?: string(name='ApiType', example='DATASTREAM'),
    clusterId?: string(name='ClusterId', example='xxx'),
    code?: string(name='Code', example='xxxxx'),
    createTime?: long(name='CreateTime', example='1595493794000'),
    creator?: string(name='Creator', example='xxx'),
    description?: string(name='Description', example='test'),
    engineVersion?: string(name='EngineVersion', example='blink-3.5.0-hotfix'),
    fileId?: string(name='FileId', example='75724'),
    folderId?: long(name='FolderId', example='26808'),
    isCommitted?: boolean(name='IsCommitted', example='true'),
    jobId?: string(name='JobId', example='rd8r1lgccsnnchh9fqwukw6e'),
    jobName?: string(name='JobName', example='datastream_enable'),
    jobType?: string(name='JobType', example='FLINK_STREAM'),
    modifier?: string(name='Modifier', example='xxx'),
    modifyTime?: long(name='ModifyTime', example='1597743765000'),
    packages?: string(name='Packages', example='big-data-1.0-snapshot.jar'),
    planJson?: string(name='PlanJson', example='{a:b}'),
    projectName?: string(name='ProjectName', example='bayes_team'),
    properties?: string(name='Properties', example='k:v'),
    queueName?: string(name='QueueName', example='root.default'),
  }(name='Job'),
  requestId?: string(name='RequestId', example='2C6E2F4C-2FA1-4159-87DA-676DB15F4826'),
}

model GetJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetJobResponseBody(name='body'),
}

/**
  * ********
  *
  * @param headers GetJobHeaders
  * @param runtime runtime options for this request RuntimeOptions
  * @return GetJobResponse
 */
async function getJobWithOptions(projectName: string, jobName: string, headers: GetJobHeaders, runtime: Util.RuntimeOptions): GetJobResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'GetJob',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * ********
  *
  * @return GetJobResponse
 */
async function getJob(projectName: string, jobName: string): GetJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new GetJobHeaders{};
  return getJobWithOptions(projectName, jobName, headers, runtime);
}

model GetJobLatestAutoScalePlanHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-shanghai'),
}

model GetJobLatestAutoScalePlanResponseBody = {
  planJson?: string(name='PlanJson', example='{k:v}'),
  requestId?: string(name='RequestId', example='FD0FF8C0-779A-45EB-9674-FF3E127B10D2'),
}

model GetJobLatestAutoScalePlanResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetJobLatestAutoScalePlanResponseBody(name='body'),
}

async function getJobLatestAutoScalePlanWithOptions(projectName: string, jobName: string, headers: GetJobLatestAutoScalePlanHeaders, runtime: Util.RuntimeOptions): GetJobLatestAutoScalePlanResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'GetJobLatestAutoScalePlan',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}/autoscale/latestplanjson`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getJobLatestAutoScalePlan(projectName: string, jobName: string): GetJobLatestAutoScalePlanResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new GetJobLatestAutoScalePlanHeaders{};
  return getJobLatestAutoScalePlanWithOptions(projectName, jobName, headers, runtime);
}

model GetProjectHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model GetProjectResponseBody = {
  project?: {
    clusterId?: string(name='ClusterId', example='rcmp9x37ztfb63g1x7lt****'),
    createTime?: long(name='CreateTime', example='1597655424000'),
    creator?: string(name='Creator', example='23996037709276****'),
    deployType?: string(name='DeployType', example='cell'),
    description?: string(name='Description', example='test'),
    globalJobConfig?: string(name='GlobalJobConfig', example='sql.type=print  datastream.main.class=test'),
    id?: string(name='Id', example='7ht9ed87rtd48bof9mu8****'),
    managerIds?: string(name='ManagerIds', example='107992689699****'),
    modifier?: string(name='Modifier', example='23996037709276****'),
    modifyTime?: long(name='ModifyTime', example='1597655424000'),
    name?: string(name='Name', example='project1'),
    region?: string(name='Region', example='cn-hangzhou'),
    state?: string(name='State', example='ENABLE'),
  }(name='Project'),
  requestId?: string(name='RequestId', example='4A6BFFEE-6C96-4727-A620-A109F50284DA'),
}

model GetProjectResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetProjectResponseBody(name='body'),
}

async function getProjectWithOptions(projectName: string, headers: GetProjectHeaders, runtime: Util.RuntimeOptions): GetProjectResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'GetProject',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getProject(projectName: string): GetProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new GetProjectHeaders{};
  return getProjectWithOptions(projectName, headers, runtime);
}

model GetRawPlanJsonHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou-pre'),
}

model GetRawPlanJsonRequest {
  advisorAction?: string(name='AdvisorAction'),
  autoconfEnable?: boolean(name='autoconfEnable', example='true'),
  expectedCore?: float(name='expectedCore', example='1'),
  expectedGB?: float(name='expectedGB', example='4'),
}

model GetRawPlanJsonResponseBody = {
  requestId?: string(name='RequestId', example='FD0FF8C0-779A-45EB-9674-FF3E127B10D2'),
  sessionId?: string(name='SessionId', example='xxxxxx'),
}

model GetRawPlanJsonResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetRawPlanJsonResponseBody(name='body'),
}

async function getRawPlanJsonWithOptions(projectName: string, jobName: string, request: GetRawPlanJsonRequest, headers: GetRawPlanJsonHeaders, runtime: Util.RuntimeOptions): GetRawPlanJsonResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.advisorAction)) {
    query['AdvisorAction'] = request.advisorAction;
  }
  if (!Util.isUnset(request.autoconfEnable)) {
    query['autoconfEnable'] = request.autoconfEnable;
  }
  if (!Util.isUnset(request.expectedCore)) {
    query['expectedCore'] = request.expectedCore;
  }
  if (!Util.isUnset(request.expectedGB)) {
    query['expectedGB'] = request.expectedGB;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetRawPlanJson',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}/planjson`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getRawPlanJson(projectName: string, jobName: string, request: GetRawPlanJsonRequest): GetRawPlanJsonResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new GetRawPlanJsonHeaders{};
  return getRawPlanJsonWithOptions(projectName, jobName, request, headers, runtime);
}

model GetRefPackageJobHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model GetRefPackageJobRequest {
  pageIndex?: int32(name='pageIndex', example='123'),
  pageSize?: int32(name='pageSize', example='50'),
}

model GetRefPackageJobResponseBody = {
  jobs?: {
    job?: [ 
    {
      apiType?: string(name='ApiType', example='DATASTREAM'),
      clusterId?: string(name='ClusterId', example='et2cloud****'),
      code?: string(name='Code', example='blink.main.class=com.hjc.test.blink_test.ChinanTopSpeedWindowing2\\r\\nblink.job.name=datastream_prestest'),
      createTime?: long(name='CreateTime', example='1551161842000'),
      creator?: string(name='Creator', example='1709064687573327'),
      description?: string(name='Description', example='test'),
      engineVersion?: string(name='EngineVersion', example='blink_2.2.4'),
      folderId?: long(name='FolderId', example='10148'),
      isCommitted?: boolean(name='IsCommitted', example='true'),
      jobId?: string(name='JobId', example='9t9m6jfw8rb44iexhbpv3tnz'),
      jobName?: string(name='JobName', example='job1'),
      jobType?: string(name='JobType', example='FLINK_STREAM'),
      modifier?: string(name='Modifier', example='1709064687573327'),
      modifyTime?: long(name='ModifyTime', example='1548397575000'),
      packages?: string(name='Packages', example='blink_test_datastream.jar'),
      planJson?: string(name='PlanJson', example='{\\n  \\"nodes\\": [\\n    {\\n      \\"id\\": 1,\\n      \\"type\\": \\"Source: Custom Source\\",\\n      \\"pact\\": \\"Data Source\\",\\n      \\"contents\\": \\"Source: Custom Source\\",\\n      \\"parallelism\\": 1\\n    },\\n    {\\n      \\"id\\": 2,\\n      \\"type\\": \\"Timestamps/Watermarks\\",\\n      \\"pact\\": \\"Operator\\",\\n      \\"contents\\": \\"Timestamps/Watermarks\\",\\n      \\"parallelism\\": 1,\\n      \\"predecessors\\": [\\n        {\\n          \\"id\\": 1,\\n          \\"ship_strategy\\": \\"FORWARD\\",\\n          \\"side\\": \\"second\\"\\n        }\\n      ]\\n    },\\n    {\\n      \\"id\\": 4,\\n      \\"type\\": \\"TriggerWindow(GlobalWindows(), ListStateDescriptor{serializer=org.apache.flink.api.common.typeutils.base.ListSerializer@b2107f67}, DeltaTrigger(com.hjc.test.blink_test.ChinanTopSpeedWindowing$1@350aac89, 50.0), TimeEvictor(10000), WindowedStream.reduce(WindowedStream.java:258))\\",\\n      \\"pact\\": \\"Operator\\",\\n      \\"contents\\": \\"TriggerWindow(GlobalWindows(), ListStateDescriptor{serializer=org.apache.flink.api.common.typeutils.base.ListSerializer@b2107f67}, DeltaTrigger(com.hjc.test.blink_test.ChinanTopSpeedWindowing$1@350aac89, 50.0), TimeEvictor(10000), WindowedStream.reduce(WindowedStream.java:258))\\",\\n      \\"parallelism\\": 1,\\n      \\"predecessors\\": [\\n        {\\n          \\"id\\": 2,\\n          \\"ship_strategy\\": \\"KEY-GROUP\\",\\n          \\"side\\": \\"second\\"\\n        }\\n      ]\\n    },\\n    {\\n      \\"id\\": 5,\\n      \\"type\\": \\"Sink: Unnamed\\",\\n      \\"pact\\": \\"Data Sink\\",\\n      \\"contents\\": \\"Sink: Unnamed\\",\\n      \\"parallelism\\": 1,\\n      \\"predecessors\\": [\\n        {\\n          \\"id\\": 4,\\n          \\"ship_strategy\\": \\"FORWARD\\",\\n          \\"side\\": \\"second\\"\\n        }\\n      ]\\n    }\\n  ]\\n}'),
      projectName?: string(name='ProjectName', example='project1'),
      properties?: string(name='Properties'),
      queueName?: string(name='QueueName', example='root.bayes_team'),
    }
  ](name='Job')
  }(name='Jobs'),
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='31FDAE27-F135-4DAB-9C75-FADD6B0C4D1D'),
  totalCount?: long(name='TotalCount', example='1'),
  totalPage?: int32(name='TotalPage', example='1'),
}

model GetRefPackageJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetRefPackageJobResponseBody(name='body'),
}

async function getRefPackageJobWithOptions(projectName: string, packageName: string, request: GetRefPackageJobRequest, headers: GetRefPackageJobHeaders, runtime: Util.RuntimeOptions): GetRefPackageJobResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.pageIndex)) {
    query['pageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetRefPackageJob',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/packages/${OpenApiUtil.getEncodeParam(packageName)}/jobs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getRefPackageJob(projectName: string, packageName: string, request: GetRefPackageJobRequest): GetRefPackageJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new GetRefPackageJobHeaders{};
  return getRefPackageJobWithOptions(projectName, packageName, request, headers, runtime);
}

model GetTaskHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId'),
}

model GetTaskResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  task?: {
    creator?: string(name='Creator'),
    gmtCreate?: long(name='GmtCreate'),
    gmtModified?: long(name='GmtModified'),
    id?: long(name='Id'),
    modifier?: string(name='Modifier'),
    name?: string(name='Name'),
    seizeHost?: string(name='SeizeHost'),
    srcProjectGlobalConfig?: string(name='SrcProjectGlobalConfig'),
    srcProjectId?: string(name='SrcProjectId'),
    srcProjectName?: string(name='SrcProjectName'),
    state?: string(name='State'),
    targetNamespace?: string(name='TargetNamespace'),
    targetUserId?: string(name='TargetUserId'),
    targetWorkspace?: string(name='TargetWorkspace'),
    transferType?: int32(name='TransferType'),
  }(name='Task'),
}

model GetTaskResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetTaskResponseBody(name='body'),
}

async function getTaskWithOptions(projectName: string, tasksId: string, headers: GetTaskHeaders, runtime: Util.RuntimeOptions): GetTaskResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'GetTask',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/vvp/projects/${OpenApiUtil.getEncodeParam(projectName)}/tasks/${OpenApiUtil.getEncodeParam(tasksId)}/tasks`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getTask(projectName: string, tasksId: string): GetTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new GetTaskHeaders{};
  return getTaskWithOptions(projectName, tasksId, headers, runtime);
}

model ListChildFolderHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model ListChildFolderRequest {
  path?: string(name='path', example='/path1'),
}

model ListChildFolderResponseBody = {
  folders?: {
    folder?: [ 
    {
      folderId?: long(name='FolderId', example='33215'),
      path?: string(name='Path', example='/path1/path2'),
    }
  ](name='Folder')
  }(name='Folders'),
  requestId?: string(name='RequestId', example='DA0A418B-E495-4BCC-B44F-1BA3CE731103'),
}

model ListChildFolderResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListChildFolderResponseBody(name='body'),
}

async function listChildFolderWithOptions(projectName: string, request: ListChildFolderRequest, headers: ListChildFolderHeaders, runtime: Util.RuntimeOptions): ListChildFolderResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.path)) {
    query['path'] = request.path;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListChildFolder',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/folders/children`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listChildFolder(projectName: string, request: ListChildFolderRequest): ListChildFolderResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ListChildFolderHeaders{};
  return listChildFolderWithOptions(projectName, request, headers, runtime);
}

model ListClusterHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model ListClusterRequest {
  clusterId?: string(name='clusterId', example='rulpqd442sgxbtw9736r****'),
  displayName?: string(name='displayName', example='demo'),
  pageIndex?: int32(name='pageIndex', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  region?: string(name='region', example='cn-beijing'),
  state?: string(name='state', example='RUNNING'),
}

model ListClusterResponseBody = {
  clusters?: {
    cluster?: [ 
    {
      clusterId?: string(name='ClusterId', example='rulpqd442sgxbtw9736r****'),
      description?: string(name='Description', example='demo'),
      displayName?: string(name='DisplayName', example='demo'),
      gmtCreate?: long(name='GmtCreate', example='1605609438000'),
      gmtModified?: long(name='GmtModified', example='1605610377000'),
      operator?: string(name='Operator', example='27395716024545****'),
      ownerId?: string(name='OwnerId', example='107992689699****'),
      regionId?: string(name='RegionId', example='cn-beijing'),
      state?: string(name='State', example='RUNNING'),
      zoneId?: string(name='ZoneId', example='cn-beijing-e'),
    }
  ](name='Cluster')
  }(name='Clusters'),
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='10C4F123-351D-4D2B-94A4-D6FF456AEA6E'),
  totalCount?: long(name='TotalCount', example='3'),
  totalPage?: int32(name='TotalPage', example='10'),
}

model ListClusterResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListClusterResponseBody(name='body'),
}

async function listClusterWithOptions(request: ListClusterRequest, headers: ListClusterHeaders, runtime: Util.RuntimeOptions): ListClusterResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.clusterId)) {
    query['clusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.displayName)) {
    query['displayName'] = request.displayName;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['pageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.region)) {
    query['region'] = request.region;
  }
  if (!Util.isUnset(request.state)) {
    query['state'] = request.state;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListCluster',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/clusters`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listCluster(request: ListClusterRequest): ListClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ListClusterHeaders{};
  return listClusterWithOptions(request, headers, runtime);
}

model ListInstanceHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou-pre'),
}

model ListInstanceRequest {
  actualState?: string(name='actualState', example='RUNNING'),
  apiType?: string(name='apiType', example='SQL'),
  endBeginTs?: long(name='endBeginTs', example='1548397575000'),
  endEndTs?: long(name='endEndTs', example='1548397575000'),
  expectState?: string(name='expectState', example='RUNNING'),
  isArchived?: boolean(name='isArchived', example='true'),
  jobName?: string(name='jobName', example='job1'),
  jobType?: string(name='jobType', example='FLINK_STREAM'),
  pageIndex?: int32(name='pageIndex', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  startBeginTs?: long(name='startBeginTs', example='1548397575000'),
  startEndTs?: long(name='startEndTs', example='1548397575000'),
}

model ListInstanceResponseBody = {
  instances?: {
    instance?: [ 
    {
      actualState?: string(name='ActualState', example='RUNNING'),
      apiType?: string(name='ApiType', example='SQL'),
      clusterId?: string(name='ClusterId', example='d6wxwo5tnrmuamx2ly3m7vkz'),
      code?: string(name='Code', example='code'),
      endTime?: long(name='EndTime', example='1548397575000'),
      engineJobHandler?: string(name='EngineJobHandler', example='application_xxxx | xxxx'),
      engineVersion?: string(name='EngineVersion', example='blink_2.2.4'),
      expectState?: string(name='ExpectState', example='RUNNING'),
      id?: long(name='Id', description='InstanceID', example='123'),
      inputDelay?: long(name='InputDelay', example='20'),
      jobName?: string(name='JobName', example='job1'),
      jobType?: string(name='JobType', example='FLINK_STREAM'),
      lastErrorMessage?: string(name='LastErrorMessage', example='error'),
      lastErrorTime?: long(name='LastErrorTime', example='1548397575000'),
      lastOperateTime?: long(name='LastOperateTime', example='1548397575000'),
      lastOperator?: string(name='LastOperator', example='xxxx'),
      packages?: string(name='Packages', example='package1.jar'),
      planJson?: string(name='PlanJson', example='{a:b}'),
      priority?: int32(name='Priority'),
      projectName?: string(name='ProjectName', example='project1'),
      properties?: string(name='Properties', example='k:v'),
      queueName?: string(name='QueueName', example='root.default'),
      startTime?: long(name='StartTime', example='1548397575000'),
      starter?: string(name='Starter', example='xxxx'),
    }
  ](name='Instance')
  }(name='Instances'),
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='FD0FF8C0-779A-45EB-9674-FF3E127B10D2'),
  totalCount?: long(name='TotalCount', example='50'),
  totalPage?: int32(name='TotalPage', example='5'),
}

model ListInstanceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListInstanceResponseBody(name='body'),
}

async function listInstanceWithOptions(projectName: string, request: ListInstanceRequest, headers: ListInstanceHeaders, runtime: Util.RuntimeOptions): ListInstanceResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.actualState)) {
    query['actualState'] = request.actualState;
  }
  if (!Util.isUnset(request.apiType)) {
    query['apiType'] = request.apiType;
  }
  if (!Util.isUnset(request.endBeginTs)) {
    query['endBeginTs'] = request.endBeginTs;
  }
  if (!Util.isUnset(request.endEndTs)) {
    query['endEndTs'] = request.endEndTs;
  }
  if (!Util.isUnset(request.expectState)) {
    query['expectState'] = request.expectState;
  }
  if (!Util.isUnset(request.isArchived)) {
    query['isArchived'] = request.isArchived;
  }
  if (!Util.isUnset(request.jobName)) {
    query['jobName'] = request.jobName;
  }
  if (!Util.isUnset(request.jobType)) {
    query['jobType'] = request.jobType;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['pageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.startBeginTs)) {
    query['startBeginTs'] = request.startBeginTs;
  }
  if (!Util.isUnset(request.startEndTs)) {
    query['startEndTs'] = request.startEndTs;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListInstance',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/instances`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listInstance(projectName: string, request: ListInstanceRequest): ListInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ListInstanceHeaders{};
  return listInstanceWithOptions(projectName, request, headers, runtime);
}

model ListJobHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou-pre'),
}

model ListJobRequest {
  apiType?: string(name='apiType', example='SQL'),
  clusterId?: string(name='clusterId', example='d6wxwo5tnrmuamx2ly3m7vkz'),
  engineVersion?: string(name='engineVersion', example='blink_2.2.4'),
  folderId?: long(name='folderId', example='123'),
  isShowFullField?: boolean(name='isShowFullField'),
  jobName?: string(name='jobName', example='job1'),
  jobType?: string(name='jobType', example='FLINK_STREAM'),
  pageIndex?: int32(name='pageIndex', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  queueName?: string(name='queueName', example='root.default'),
}

model ListJobResponseBody = {
  jobs?: {
    job?: [ 
    {
      apiType?: string(name='ApiType', example='SQL'),
      clusterId?: string(name='ClusterId', example='d6wxwo5tnrmuamx2ly3m7vkz'),
      code?: string(name='Code', example='code'),
      createTime?: long(name='CreateTime', example='1548397575000'),
      creator?: string(name='Creator', example='xxxx'),
      description?: string(name='Description', example='test'),
      engineVersion?: string(name='EngineVersion', example='blink_2.2.4'),
      folderId?: long(name='FolderId', example='123'),
      isCommitted?: boolean(name='IsCommitted', example='true'),
      jobId?: string(name='JobId'),
      jobName?: string(name='JobName', example='job1'),
      jobType?: string(name='JobType', example='FLINK_STREAM'),
      modifier?: string(name='Modifier', example='xxxx'),
      modifyTime?: long(name='ModifyTime', example='1548397575000'),
      packages?: string(name='Packages', example='package1.jar'),
      planJson?: string(name='PlanJson', example='{a:b}'),
      projectName?: string(name='ProjectName', example='project1'),
      properties?: string(name='Properties', example='k:v'),
      queueName?: string(name='QueueName', example='root.default'),
    }
  ](name='Job')
  }(name='Jobs'),
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='FD0FF8C0-779A-45EB-9674-FF3E127B10D2'),
  totalCount?: long(name='TotalCount', example='50'),
  totalPage?: int32(name='TotalPage', example='5'),
}

model ListJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListJobResponseBody(name='body'),
}

async function listJobWithOptions(projectName: string, request: ListJobRequest, headers: ListJobHeaders, runtime: Util.RuntimeOptions): ListJobResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.apiType)) {
    query['apiType'] = request.apiType;
  }
  if (!Util.isUnset(request.clusterId)) {
    query['clusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.engineVersion)) {
    query['engineVersion'] = request.engineVersion;
  }
  if (!Util.isUnset(request.folderId)) {
    query['folderId'] = request.folderId;
  }
  if (!Util.isUnset(request.isShowFullField)) {
    query['isShowFullField'] = request.isShowFullField;
  }
  if (!Util.isUnset(request.jobName)) {
    query['jobName'] = request.jobName;
  }
  if (!Util.isUnset(request.jobType)) {
    query['jobType'] = request.jobType;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['pageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.queueName)) {
    query['queueName'] = request.queueName;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListJob',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listJob(projectName: string, request: ListJobRequest): ListJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ListJobHeaders{};
  return listJobWithOptions(projectName, request, headers, runtime);
}

model ListNamespaceHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId'),
}

model ListNamespaceRequest {
  targetUserId?: string(name='targetUserId'),
  transferType?: int32(name='transferType'),
  workspaceId?: string(name='workspaceId'),
}

model ListNamespaceResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  namespaces?: [ 
    {
      createTime?: long(name='CreateTime'),
      lifecyclePhase?: string(name='LifecyclePhase'),
      name?: string(name='Name'),
      previewSessionClusterName?: string(name='PreviewSessionClusterName'),
      roleBindings?: [ 
        {
          members?: [ string ](name='Members'),
          role?: string(name='Role'),
        }
      ](name='RoleBindings'),
      workspace?: string(name='Workspace'),
    }
  ](name='Namespaces'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListNamespaceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListNamespaceResponseBody(name='body'),
}

async function listNamespaceWithOptions(request: ListNamespaceRequest, headers: ListNamespaceHeaders, runtime: Util.RuntimeOptions): ListNamespaceResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.targetUserId)) {
    query['targetUserId'] = request.targetUserId;
  }
  if (!Util.isUnset(request.transferType)) {
    query['transferType'] = request.transferType;
  }
  if (!Util.isUnset(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListNamespace',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/vvp/namespaces`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listNamespace(request: ListNamespaceRequest): ListNamespaceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ListNamespaceHeaders{};
  return listNamespaceWithOptions(request, headers, runtime);
}

model ListNodeHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId'),
}

model ListNodeRequest {
  actualStates?: [ int32 ](name='actualStates'),
  apiType?: [ string ](name='apiType'),
  creators?: [ string ](name='creators'),
  folderId?: long(name='folderId'),
  isFuzzyQuery?: boolean(name='isFuzzyQuery'),
  jobType?: string(name='jobType'),
  migrateState?: string(name='migrateState'),
  name?: string(name='name'),
  pageIndex?: int32(name='pageIndex'),
  pageSize?: int32(name='pageSize'),
}

model ListNodeShrinkRequest {
  actualStatesShrink?: string(name='actualStates'),
  apiTypeShrink?: string(name='apiType'),
  creatorsShrink?: string(name='creators'),
  folderId?: long(name='folderId'),
  isFuzzyQuery?: boolean(name='isFuzzyQuery'),
  jobType?: string(name='jobType'),
  migrateState?: string(name='migrateState'),
  name?: string(name='name'),
  pageIndex?: int32(name='pageIndex'),
  pageSize?: int32(name='pageSize'),
}

model ListNodeResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  nodes?: [ 
    {
      actualState?: int32(name='ActualState'),
      apiType?: string(name='ApiType'),
      creator?: string(name='Creator'),
      creatorName?: string(name='CreatorName'),
      expectState?: int32(name='ExpectState'),
      folderId?: string(name='FolderId'),
      folderName?: string(name='FolderName'),
      gmtCreate?: long(name='GmtCreate'),
      gmtModified?: long(name='GmtModified'),
      jobType?: string(name='JobType'),
      migrateState?: string(name='MigrateState'),
      modifier?: string(name='Modifier'),
      name?: string(name='Name'),
      nodeId?: string(name='NodeId'),
      priority?: int32(name='Priority'),
    }
  ](name='Nodes'),
  pageIndex?: int32(name='PageIndex'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  totalCount?: long(name='TotalCount'),
  totalPage?: int32(name='TotalPage'),
}

model ListNodeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListNodeResponseBody(name='body'),
}

async function listNodeWithOptions(projectName: string, tmpReq: ListNodeRequest, headers: ListNodeHeaders, runtime: Util.RuntimeOptions): ListNodeResponse {
  Util.validateModel(tmpReq);
  var request = new ListNodeShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.actualStates)) {
    request.actualStatesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.actualStates, 'actualStates', 'simple');
  }
  if (!Util.isUnset(tmpReq.apiType)) {
    request.apiTypeShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.apiType, 'apiType', 'simple');
  }
  if (!Util.isUnset(tmpReq.creators)) {
    request.creatorsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.creators, 'creators', 'simple');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.actualStatesShrink)) {
    query['actualStates'] = request.actualStatesShrink;
  }
  if (!Util.isUnset(request.apiTypeShrink)) {
    query['apiType'] = request.apiTypeShrink;
  }
  if (!Util.isUnset(request.creatorsShrink)) {
    query['creators'] = request.creatorsShrink;
  }
  if (!Util.isUnset(request.folderId)) {
    query['folderId'] = request.folderId;
  }
  if (!Util.isUnset(request.isFuzzyQuery)) {
    query['isFuzzyQuery'] = request.isFuzzyQuery;
  }
  if (!Util.isUnset(request.jobType)) {
    query['jobType'] = request.jobType;
  }
  if (!Util.isUnset(request.migrateState)) {
    query['migrateState'] = request.migrateState;
  }
  if (!Util.isUnset(request.name)) {
    query['name'] = request.name;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['pageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListNode',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/vvp/projects/${OpenApiUtil.getEncodeParam(projectName)}/node`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listNode(projectName: string, request: ListNodeRequest): ListNodeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ListNodeHeaders{};
  return listNodeWithOptions(projectName, request, headers, runtime);
}

model ListPackageHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model ListPackageRequest {
  packageName?: string(name='packageName', example='package1.jar'),
  pageIndex?: int32(name='pageIndex', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  tag?: string(name='tag', example='{"function":"group by time"}'),
  type?: string(name='type', example='JAR'),
}

model ListPackageResponseBody = {
  packages?: {
    package?: [ 
    {
      createTime?: long(name='CreateTime', example='1600156643000'),
      creator?: string(name='Creator', example='1709064687573327'),
      description?: string(name='Description', example='adas'),
      md5?: string(name='Md5', example='e0899e291f0524c6e6572c126599f73b'),
      modifier?: string(name='Modifier', example='1709064687573327'),
      modifyTime?: long(name='ModifyTime', example='1600156643000'),
      originName?: string(name='OriginName', example='aliyun-java-sdk-foas-2.9.0.jar'),
      ossBucket?: string(name='OssBucket', description='OssBucket', example='79zec7svps7hca0xnogbqpvu/aliyun-java-sdk-foas-2.9.0.jar/l1jsjfzlps4z4pk5rhutb91k.bayes'),
      ossEndpoint?: string(name='OssEndpoint', example='oss-cn-hangzhou-internal.aliyuncs.com'),
      ossOwner?: string(name='OssOwner', example='owner1'),
      ossPath?: string(name='OssPath', example='path1/path2/a.jar'),
      packageName?: string(name='PackageName', example='aliyun-java-sdk-foas-2.9.0.jar'),
      projectName?: string(name='ProjectName', example='project1'),
      scanErrorMessage?: string(name='ScanErrorMessage'),
      scanExtBizNo?: string(name='ScanExtBizNo'),
      scanLink?: string(name='ScanLink'),
      scanState?: string(name='ScanState'),
      tag?: string(name='Tag', example='{"function":"group by time"}'),
      type?: string(name='Type', example='JAR'),
    }
  ](name='Package')
  }(name='Packages'),
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='F33B93C0-56E6-43BD-B30F-E1FF1D4EF1EE'),
  totalCount?: long(name='TotalCount', example='4'),
  totalPage?: int32(name='TotalPage', example='1'),
}

model ListPackageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListPackageResponseBody(name='body'),
}

async function listPackageWithOptions(projectName: string, request: ListPackageRequest, headers: ListPackageHeaders, runtime: Util.RuntimeOptions): ListPackageResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.packageName)) {
    query['packageName'] = request.packageName;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['pageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.tag)) {
    query['tag'] = request.tag;
  }
  if (!Util.isUnset(request.type)) {
    query['type'] = request.type;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListPackage',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/packages`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listPackage(projectName: string, request: ListPackageRequest): ListPackageResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ListPackageHeaders{};
  return listPackageWithOptions(projectName, request, headers, runtime);
}

model ListProjectHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model ListProjectRequest {
  clusterId?: string(name='clusterId', example='cmy99ugusuco66x9qc6k****'),
  deployType?: string(name='deployType', example='cell'),
  name?: string(name='name', example='job1'),
  pageIndex?: int32(name='pageIndex', example='2'),
  pageSize?: int32(name='pageSize', example='1'),
  region?: string(name='region', example='cn-hangzhou'),
}

model ListProjectResponseBody = {
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  projects?: {
    project?: [ 
    {
      clusterId?: string(name='ClusterId', example='rcmp9x37ztfb63g1x7lt****'),
      createTime?: long(name='CreateTime', example='1597655424000'),
      creator?: string(name='Creator', example='23996037709276****'),
      deployType?: string(name='DeployType', example='CELL'),
      description?: string(name='Description', example='test'),
      id?: string(name='Id', example='e8edisrtou71a2neroi5f3kc'),
      managerIds?: string(name='ManagerIds', example='1079926896999421'),
      modifier?: string(name='Modifier', example='27395716024545****'),
      modifyTime?: long(name='ModifyTime', example='1605610424000'),
      name?: string(name='Name', example='project1'),
      region?: string(name='Region', example='cn-hangzhou'),
      state?: string(name='State', example='ENABLE'),
    }
  ](name='Project')
  }(name='Projects'),
  requestId?: string(name='RequestId', example='5A0EA261-AA2F-47FF-B7D9-A785ED1D0ADE'),
  totalCount?: long(name='TotalCount', example='3'),
  totalPage?: int32(name='TotalPage', example='1'),
}

model ListProjectResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListProjectResponseBody(name='body'),
}

async function listProjectWithOptions(request: ListProjectRequest, headers: ListProjectHeaders, runtime: Util.RuntimeOptions): ListProjectResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.clusterId)) {
    query['clusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.deployType)) {
    query['deployType'] = request.deployType;
  }
  if (!Util.isUnset(request.name)) {
    query['name'] = request.name;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['pageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.region)) {
    query['region'] = request.region;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListProject',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listProject(request: ListProjectRequest): ListProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ListProjectHeaders{};
  return listProjectWithOptions(request, headers, runtime);
}

model ListProjectBindQueueHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model ListProjectBindQueueRequest {
  clusterId?: string(name='clusterId', example='d6wxwo5tnrmuamx2ly3m****'),
  queueName?: string(name='queueName', example='root.project1'),
}

model ListProjectBindQueueResponseBody = {
  queues?: {
    queue?: [ 
    {
      clusterId?: string(name='ClusterId', example='d6wxwo5tnrmuamx2ly3m****'),
      queueName?: string(name='QueueName', example='root.project1'),
    }
  ](name='Queue')
  }(name='Queues'),
  requestId?: string(name='RequestId', example='36277E3E-99BA-43C7-8F91-ADCC8FE1EC96'),
}

model ListProjectBindQueueResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListProjectBindQueueResponseBody(name='body'),
}

async function listProjectBindQueueWithOptions(projectName: string, request: ListProjectBindQueueRequest, headers: ListProjectBindQueueHeaders, runtime: Util.RuntimeOptions): ListProjectBindQueueResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.clusterId)) {
    query['clusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.queueName)) {
    query['queueName'] = request.queueName;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListProjectBindQueue',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/queues`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listProjectBindQueue(projectName: string, request: ListProjectBindQueueRequest): ListProjectBindQueueResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ListProjectBindQueueHeaders{};
  return listProjectBindQueueWithOptions(projectName, request, headers, runtime);
}

model ListProjectBindQueueResourceHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model ListProjectBindQueueResourceRequest {
  clusterId?: string(name='clusterId', example='d6wxwo5tnrmuamx2ly3m****'),
  queueName?: string(name='queueName', example='root.project1'),
}

model ListProjectBindQueueResourceResponseBody = {
  queues?: {
    queue?: [ 
    {
      clusterId?: string(name='ClusterId', example='d6wxwo5tnrmuamx2ly3m****'),
      maxGpu?: int32(name='MaxGpu', example='0'),
      maxMem?: int32(name='MaxMem', example='24576'),
      maxVCore?: int32(name='MaxVCore', example='600'),
      minGpu?: int32(name='MinGpu', example='0'),
      minMem?: int32(name='MinMem', example='24535'),
      minVCore?: int32(name='MinVCore', example='599'),
      queueName?: string(name='QueueName', example='root.project1'),
      usedGpu?: int32(name='UsedGpu', example='0'),
      usedMem?: int32(name='UsedMem', example='10496'),
      usedVCore?: int32(name='UsedVCore', example='250'),
    }
  ](name='Queue')
  }(name='Queues'),
  requestId?: string(name='RequestId', example='2127A47D-CB91-44AE-8277-3FC645A761CE'),
}

model ListProjectBindQueueResourceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListProjectBindQueueResourceResponseBody(name='body'),
}

async function listProjectBindQueueResourceWithOptions(projectName: string, request: ListProjectBindQueueResourceRequest, headers: ListProjectBindQueueResourceHeaders, runtime: Util.RuntimeOptions): ListProjectBindQueueResourceResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.clusterId)) {
    query['clusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.queueName)) {
    query['queueName'] = request.queueName;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListProjectBindQueueResource',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/queueresource`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listProjectBindQueueResource(projectName: string, request: ListProjectBindQueueResourceRequest): ListProjectBindQueueResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ListProjectBindQueueResourceHeaders{};
  return listProjectBindQueueResourceWithOptions(projectName, request, headers, runtime);
}

model ListProjectUserHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId'),
}

model ListProjectUserRequest {
  pageIndex?: int32(name='pageIndex'),
  pageSize?: int32(name='pageSize'),
}

model ListProjectUserResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  pageIndex?: int32(name='PageIndex'),
  pageSize?: int32(name='PageSize'),
  projectUsers?: [ 
    {
      projectName?: string(name='ProjectName'),
      role?: string(name='Role'),
      user?: string(name='User'),
    }
  ](name='ProjectUsers'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  totalCount?: long(name='TotalCount'),
  totalPage?: int32(name='TotalPage'),
}

model ListProjectUserResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListProjectUserResponseBody(name='body'),
}

async function listProjectUserWithOptions(projectName: string, request: ListProjectUserRequest, headers: ListProjectUserHeaders, runtime: Util.RuntimeOptions): ListProjectUserResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.pageIndex)) {
    query['pageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListProjectUser',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/users`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listProjectUser(projectName: string, request: ListProjectUserRequest): ListProjectUserResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ListProjectUserHeaders{};
  return listProjectUserWithOptions(projectName, request, headers, runtime);
}

model ListTagResourcesHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId'),
}

model ListTagResourcesRequest {
  nextToken?: string(name='NextToken'),
  resourceIds?: string(name='ResourceIds'),
  resourceType?: string(name='ResourceType'),
  tags?: string(name='Tags'),
}

model ListTagResourcesResponseBody = {
  code?: string(name='Code'),
  data?: {
    nextToken?: string(name='NextToken'),
    tagResources?: [ 
      {
        resourceId?: string(name='ResourceId'),
        resourceType?: string(name='ResourceType'),
        tagKey?: string(name='TagKey'),
        tagValue?: string(name='TagValue'),
      }
    ](name='TagResources'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListTagResourcesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListTagResourcesResponseBody(name='body'),
}

async function listTagResourcesWithOptions(request: ListTagResourcesRequest, headers: ListTagResourcesHeaders, runtime: Util.RuntimeOptions): ListTagResourcesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.resourceIds)) {
    query['ResourceIds'] = request.resourceIds;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tags)) {
    query['Tags'] = request.tags;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTagResources',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/cluster/tags`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ListTagResourcesHeaders{};
  return listTagResourcesWithOptions(request, headers, runtime);
}

model ListTaskHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId'),
}

model ListTaskRequest {
  name?: string(name='name'),
  pageIndex?: int32(name='pageIndex'),
  pageSize?: int32(name='pageSize'),
}

model ListTaskResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  pageIndex?: int32(name='PageIndex'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  tasks?: [ 
    {
      canRun?: boolean(name='CanRun'),
      creator?: string(name='Creator'),
      gmtCreate?: long(name='GmtCreate'),
      gmtModified?: long(name='GmtModified'),
      id?: long(name='Id'),
      modifier?: string(name='Modifier'),
      name?: string(name='Name'),
      seizeHost?: string(name='SeizeHost'),
      srcProjectGlobalConfig?: string(name='SrcProjectGlobalConfig'),
      srcProjectId?: string(name='SrcProjectId'),
      srcProjectName?: string(name='SrcProjectName'),
      state?: string(name='State'),
      targetNamespace?: string(name='TargetNamespace'),
      targetUserId?: string(name='TargetUserId'),
      targetWorkspace?: string(name='TargetWorkspace'),
      transferType?: int32(name='TransferType'),
    }
  ](name='Tasks'),
  totalCount?: long(name='TotalCount'),
  totalPage?: int32(name='TotalPage'),
}

model ListTaskResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListTaskResponseBody(name='body'),
}

async function listTaskWithOptions(projectName: string, request: ListTaskRequest, headers: ListTaskHeaders, runtime: Util.RuntimeOptions): ListTaskResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    query['name'] = request.name;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['pageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTask',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/vvp/projects/${OpenApiUtil.getEncodeParam(projectName)}/tasks`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listTask(projectName: string, request: ListTaskRequest): ListTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ListTaskHeaders{};
  return listTaskWithOptions(projectName, request, headers, runtime);
}

model ListTaskJobHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId'),
}

model ListTaskJobRequest {
  pageIndex?: int32(name='pageIndex'),
  pageSize?: int32(name='pageSize'),
  state?: [ string ](name='state'),
}

model ListTaskJobShrinkRequest {
  pageIndex?: int32(name='pageIndex'),
  pageSize?: int32(name='pageSize'),
  stateShrink?: string(name='state'),
}

model ListTaskJobResponseBody = {
  code?: string(name='Code'),
  jobs?: [ 
    {
      apiType?: string(name='ApiType'),
      blinkVersion?: string(name='BlinkVersion'),
      creator?: string(name='Creator'),
      errorMsg?: string(name='ErrorMsg'),
      gmtCreate?: long(name='GmtCreate'),
      gmtModified?: long(name='GmtModified'),
      id?: long(name='Id'),
      instanceId?: long(name='InstanceId'),
      modifier?: string(name='Modifier'),
      nodeId?: string(name='NodeId'),
      nodeName?: string(name='NodeName'),
      seizeHost?: string(name='SeizeHost'),
      srcProperties?: string(name='SrcProperties'),
      srcSql?: string(name='SrcSql'),
      state?: string(name='State'),
      targetProperties?: string(name='TargetProperties'),
      targetSql?: string(name='TargetSql'),
      taskId?: long(name='TaskId'),
    }
  ](name='Jobs'),
  message?: string(name='Message'),
  pageIndex?: int32(name='PageIndex'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  totalCount?: long(name='TotalCount'),
  totalPage?: int32(name='TotalPage'),
}

model ListTaskJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListTaskJobResponseBody(name='body'),
}

async function listTaskJobWithOptions(projectName: string, tasksId: string, tmpReq: ListTaskJobRequest, headers: ListTaskJobHeaders, runtime: Util.RuntimeOptions): ListTaskJobResponse {
  Util.validateModel(tmpReq);
  var request = new ListTaskJobShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.state)) {
    request.stateShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.state, 'state', 'simple');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.pageIndex)) {
    query['pageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.stateShrink)) {
    query['state'] = request.stateShrink;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTaskJob',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/vvp/projects/${OpenApiUtil.getEncodeParam(projectName)}/tasks/${OpenApiUtil.getEncodeParam(tasksId)}/jobs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listTaskJob(projectName: string, tasksId: string, request: ListTaskJobRequest): ListTaskJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ListTaskJobHeaders{};
  return listTaskJobWithOptions(projectName, tasksId, request, headers, runtime);
}

model ListWhitelistUserHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId'),
}

model ListWhitelistUserRequest {
  pageIndex?: int32(name='pageIndex'),
  pageSize?: int32(name='pageSize'),
  state?: int32(name='state'),
  userId?: string(name='userId'),
}

model ListWhitelistUserResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  pageIndex?: int32(name='PageIndex'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  totalCount?: long(name='TotalCount'),
  totalPage?: int32(name='TotalPage'),
  whitelistUsers?: [ 
    {
      gmtCreate?: long(name='GmtCreate'),
      gmtModified?: long(name='GmtModified'),
      id?: long(name='Id'),
      remark?: string(name='Remark'),
      state?: int32(name='State'),
      userId?: string(name='UserId'),
      userName?: string(name='UserName'),
    }
  ](name='WhitelistUsers'),
}

model ListWhitelistUserResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListWhitelistUserResponseBody(name='body'),
}

async function listWhitelistUserWithOptions(request: ListWhitelistUserRequest, headers: ListWhitelistUserHeaders, runtime: Util.RuntimeOptions): ListWhitelistUserResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.pageIndex)) {
    query['pageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.state)) {
    query['state'] = request.state;
  }
  if (!Util.isUnset(request.userId)) {
    query['userId'] = request.userId;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListWhitelistUser',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/vvp/whitelist/search`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listWhitelistUser(request: ListWhitelistUserRequest): ListWhitelistUserResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ListWhitelistUserHeaders{};
  return listWhitelistUserWithOptions(request, headers, runtime);
}

model MVFolderHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model MVFolderRequest {
  destPath?: string(name='destPath', example='/path2'),
  srcPath?: string(name='srcPath', example='/path1'),
}

model MVFolderResponseBody = {
  requestId?: string(name='RequestId', example='D34CBA74-DED8-4B1E-80B4-DE4C58291726'),
}

model MVFolderResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: MVFolderResponseBody(name='body'),
}

async function mVFolderWithOptions(projectName: string, request: MVFolderRequest, headers: MVFolderHeaders, runtime: Util.RuntimeOptions): MVFolderResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.destPath)) {
    body['destPath'] = request.destPath;
  }
  if (!Util.isUnset(request.srcPath)) {
    body['srcPath'] = request.srcPath;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'MVFolder',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/folders`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function mVFolder(projectName: string, request: MVFolderRequest): MVFolderResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new MVFolderHeaders{};
  return mVFolderWithOptions(projectName, request, headers, runtime);
}

model ModifyInstanceStateHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model ModifyInstanceStateRequest {
  expectState?: string(name='expectState', example='RUNNING'),
  isFlush?: boolean(name='isFlush', example='true'),
  triggerCheckpoint?: boolean(name='triggerCheckpoint', example='true'),
}

model ModifyInstanceStateResponseBody = {
  requestId?: string(name='RequestId', example='EA0059FA-FD69-4A83-B216-6B36B03129A7'),
}

model ModifyInstanceStateResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyInstanceStateResponseBody(name='body'),
}

async function modifyInstanceStateWithOptions(projectName: string, jobName: string, instanceId: string, request: ModifyInstanceStateRequest, headers: ModifyInstanceStateHeaders, runtime: Util.RuntimeOptions): ModifyInstanceStateResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.expectState)) {
    body['expectState'] = request.expectState;
  }
  if (!Util.isUnset(request.isFlush)) {
    body['isFlush'] = request.isFlush;
  }
  if (!Util.isUnset(request.triggerCheckpoint)) {
    body['triggerCheckpoint'] = request.triggerCheckpoint;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyInstanceState',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}/instances/${OpenApiUtil.getEncodeParam(instanceId)}/expectstate`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyInstanceState(projectName: string, jobName: string, instanceId: string, request: ModifyInstanceStateRequest): ModifyInstanceStateResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ModifyInstanceStateHeaders{};
  return modifyInstanceStateWithOptions(projectName, jobName, instanceId, request, headers, runtime);
}

model ModifyMasterSpecHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model ModifyMasterSpecRequest {
  masterTargetModel?: string(name='masterTargetModel', example='Ecs_4c16g'),
}

model ModifyMasterSpecResponseBody = {
  requestId?: string(name='RequestId', example='C5C6746D-2FFC-4D5D-A6A8-FA8DF7585DC2'),
}

model ModifyMasterSpecResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyMasterSpecResponseBody(name='body'),
}

async function modifyMasterSpecWithOptions(clusterId: string, request: ModifyMasterSpecRequest, headers: ModifyMasterSpecHeaders, runtime: Util.RuntimeOptions): ModifyMasterSpecResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.masterTargetModel)) {
    body['masterTargetModel'] = request.masterTargetModel;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyMasterSpec',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/clusters/${OpenApiUtil.getEncodeParam(clusterId)}/specification`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyMasterSpec(clusterId: string, request: ModifyMasterSpecRequest): ModifyMasterSpecResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ModifyMasterSpecHeaders{};
  return modifyMasterSpecWithOptions(clusterId, request, headers, runtime);
}

model OfflineJobHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model OfflineJobResponseBody = {
  requestId?: string(name='RequestId', example='5A0AF0E2-A715-40FD-8A2B-1EDBF4213489'),
}

model OfflineJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: OfflineJobResponseBody(name='body'),
}

async function offlineJobWithOptions(projectName: string, jobName: string, headers: OfflineJobHeaders, runtime: Util.RuntimeOptions): OfflineJobResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'OfflineJob',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}/offline`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function offlineJob(projectName: string, jobName: string): OfflineJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new OfflineJobHeaders{};
  return offlineJobWithOptions(projectName, jobName, headers, runtime);
}

model RunTaskHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId'),
}

model RunTaskResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  task?: {
    creator?: string(name='Creator'),
    gmtCreate?: long(name='GmtCreate'),
    gmtModified?: long(name='GmtModified'),
    id?: long(name='Id'),
    modifier?: string(name='Modifier'),
    name?: string(name='Name'),
    seizeHost?: string(name='SeizeHost'),
    srcProjectGlobalConfig?: string(name='SrcProjectGlobalConfig'),
    srcProjectId?: string(name='SrcProjectId'),
    srcProjectName?: string(name='SrcProjectName'),
    state?: string(name='State'),
    targetNamespace?: string(name='TargetNamespace'),
    targetUserId?: string(name='TargetUserId'),
    targetWorkspace?: string(name='TargetWorkspace'),
    transferType?: int32(name='TransferType'),
  }(name='Task'),
}

model RunTaskResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RunTaskResponseBody(name='body'),
}

async function runTaskWithOptions(tasksId: string, projectName: string, headers: RunTaskHeaders, runtime: Util.RuntimeOptions): RunTaskResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'RunTask',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/vvp/projects/${OpenApiUtil.getEncodeParam(projectName)}/tasks/${OpenApiUtil.getEncodeParam(tasksId)}/runTask`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function runTask(tasksId: string, projectName: string): RunTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new RunTaskHeaders{};
  return runTaskWithOptions(tasksId, projectName, headers, runtime);
}

model ShrinkClusterHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model ShrinkClusterRequest {
  instanceIds?: string(name='instanceIds', example='xxxxxx'),
  modelTargetCount?: string(name='modelTargetCount', example='2'),
}

model ShrinkClusterResponseBody = {
  requestId?: string(name='RequestId', example='FD0FF8C0-779A-45EB-9674-FF3E127B10D2'),
}

model ShrinkClusterResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ShrinkClusterResponseBody(name='body'),
}

async function shrinkClusterWithOptions(clusterId: string, request: ShrinkClusterRequest, headers: ShrinkClusterHeaders, runtime: Util.RuntimeOptions): ShrinkClusterResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceIds)) {
    body['instanceIds'] = request.instanceIds;
  }
  if (!Util.isUnset(request.modelTargetCount)) {
    body['modelTargetCount'] = request.modelTargetCount;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ShrinkCluster',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/clusters/${OpenApiUtil.getEncodeParam(clusterId)}/shrink`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function shrinkCluster(clusterId: string, request: ShrinkClusterRequest): ShrinkClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ShrinkClusterHeaders{};
  return shrinkClusterWithOptions(clusterId, request, headers, runtime);
}

model StartJobHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model StartJobRequest {
  parameterJson?: map[string]any(name='parameterJson', example='{"blink.checkpoint.interval.ms":"180000"}'),
}

model StartJobResponseBody = {
  requestId?: string(name='RequestId', example='5313EF6E-6E3F-45DB-8E33-20DA279D8F3F'),
  instanceId?: long(name='instanceId', example='415854'),
}

model StartJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: StartJobResponseBody(name='body'),
}

async function startJobWithOptions(projectName: string, jobName: string, request: StartJobRequest, headers: StartJobHeaders, runtime: Util.RuntimeOptions): StartJobResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.parameterJson)) {
    body['parameterJson'] = request.parameterJson;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StartJob',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}/instance`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function startJob(projectName: string, jobName: string, request: StartJobRequest): StartJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new StartJobHeaders{};
  return startJobWithOptions(projectName, jobName, request, headers, runtime);
}

model TagResourcesHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId'),
}

model TagResourcesResponseBody = {
  code?: string(name='Code'),
  data?: boolean(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model TagResourcesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: TagResourcesResponseBody(name='body'),
}

async function tagResourcesWithOptions(headers: TagResourcesHeaders, runtime: Util.RuntimeOptions): TagResourcesResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'TagResources',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/cluster/tags`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function tagResources(): TagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new TagResourcesHeaders{};
  return tagResourcesWithOptions(headers, runtime);
}

model UnbindQueueHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model UnbindQueueRequest {
  clusterId?: string(name='clusterId', example='cmy99ugusuco66x9qc6k****'),
  queueName?: string(name='queueName', example='queue1'),
}

model UnbindQueueResponseBody = {
  requestId?: string(name='RequestId', example='C5C6746D-2FFC-4D5D-A6A8-FA8DF7585DC2'),
}

model UnbindQueueResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UnbindQueueResponseBody(name='body'),
}

async function unbindQueueWithOptions(projectName: string, request: UnbindQueueRequest, headers: UnbindQueueHeaders, runtime: Util.RuntimeOptions): UnbindQueueResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.clusterId)) {
    query['clusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.queueName)) {
    query['queueName'] = request.queueName;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UnbindQueue',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/queue`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function unbindQueue(projectName: string, request: UnbindQueueRequest): UnbindQueueResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new UnbindQueueHeaders{};
  return unbindQueueWithOptions(projectName, request, headers, runtime);
}

model UntagResourcesHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId'),
}

model UntagResourcesRequest {
  all?: boolean(name='All'),
  resourceIds?: string(name='ResourceIds'),
  resourceType?: string(name='ResourceType'),
  tagKeys?: string(name='TagKeys'),
}

model UntagResourcesResponseBody = {
  code?: string(name='Code'),
  data?: boolean(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UntagResourcesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UntagResourcesResponseBody(name='body'),
}

async function untagResourcesWithOptions(request: UntagResourcesRequest, headers: UntagResourcesHeaders, runtime: Util.RuntimeOptions): UntagResourcesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.all)) {
    query['All'] = request.all;
  }
  if (!Util.isUnset(request.resourceIds)) {
    query['ResourceIds'] = request.resourceIds;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tagKeys)) {
    query['TagKeys'] = request.tagKeys;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UntagResources',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/cluster/tags`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new UntagResourcesHeaders{};
  return untagResourcesWithOptions(request, headers, runtime);
}

model UpdateAutoScaleConfigHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-shanghai'),
}

model UpdateAutoScaleConfigRequest {
  configJson?: map[string]any(name='configJson', example='{"autoscale.enable":"true"}'),
}

model UpdateAutoScaleConfigResponseBody = {
  requestId?: string(name='RequestId', example='A017B343-33DC-4A97-BAC5-4B57872D5B61'),
}

model UpdateAutoScaleConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateAutoScaleConfigResponseBody(name='body'),
}

async function updateAutoScaleConfigWithOptions(projectName: string, jobName: string, instanceId: string, request: UpdateAutoScaleConfigRequest, headers: UpdateAutoScaleConfigHeaders, runtime: Util.RuntimeOptions): UpdateAutoScaleConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.configJson)) {
    body['configJson'] = request.configJson;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAutoScaleConfig',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}/instance/${OpenApiUtil.getEncodeParam(instanceId)}/autoscale/config`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateAutoScaleConfig(projectName: string, jobName: string, instanceId: string, request: UpdateAutoScaleConfigRequest): UpdateAutoScaleConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new UpdateAutoScaleConfigHeaders{};
  return updateAutoScaleConfigWithOptions(projectName, jobName, instanceId, request, headers, runtime);
}

model UpdateJobHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model UpdateJobRequest {
  clusterId?: string(name='clusterId', example='d6wxwo5tnrmuamx2ly3m7vkz'),
  code?: string(name='code', example='code'),
  description?: string(name='description', example='test'),
  engineVersion?: string(name='engineVersion', example='blink_2.2.4'),
  folderId?: long(name='folderId', example='123'),
  packages?: string(name='packages', example='package1.jar'),
  planJson?: string(name='planJson', example='{a:b}'),
  properties?: string(name='properties', example='blink.checkpoint.interval.ms:180000'),
  queueName?: string(name='queueName', example='root.default'),
}

model UpdateJobResponseBody = {
  requestId?: string(name='RequestId', example='C3FC248C-1CF4-4A64-97C1-0BD667A4D09D'),
}

model UpdateJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateJobResponseBody(name='body'),
}

async function updateJobWithOptions(projectName: string, jobName: string, request: UpdateJobRequest, headers: UpdateJobHeaders, runtime: Util.RuntimeOptions): UpdateJobResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clusterId)) {
    body['clusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.code)) {
    body['code'] = request.code;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.engineVersion)) {
    body['engineVersion'] = request.engineVersion;
  }
  if (!Util.isUnset(request.folderId)) {
    body['folderId'] = request.folderId;
  }
  if (!Util.isUnset(request.packages)) {
    body['packages'] = request.packages;
  }
  if (!Util.isUnset(request.planJson)) {
    body['planJson'] = request.planJson;
  }
  if (!Util.isUnset(request.properties)) {
    body['properties'] = request.properties;
  }
  if (!Util.isUnset(request.queueName)) {
    body['queueName'] = request.queueName;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateJob',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateJob(projectName: string, jobName: string, request: UpdateJobRequest): UpdateJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new UpdateJobHeaders{};
  return updateJobWithOptions(projectName, jobName, request, headers, runtime);
}

model UpdatePackageHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model UpdatePackageRequest {
  description?: string(name='description', example='test'),
  md5?: string(name='md5', example='3F7468C153E529B141C326332DF15D05'),
  originName?: string(name='originName', example='package2.jar'),
  ossBucket?: string(name='ossBucket', description='OSS Bucket', example='blinktest2.oss-cn-hangzhou-internal.aliyuncs.com'),
  ossEndpoint?: string(name='ossEndpoint', example='oss-cn-hangzhou-internal.aliyuncs.com'),
  ossOwner?: string(name='ossOwner', example='owner1'),
  ossPath?: string(name='ossPath', example='path1/path2/a.jar'),
  tag?: string(name='tag', example='{"function":"group by time"}'),
}

model UpdatePackageResponseBody = {
  requestId?: string(name='RequestId', example='77D5CB98-5E9F-42BB-8AA9-001125B48E28'),
}

model UpdatePackageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdatePackageResponseBody(name='body'),
}

async function updatePackageWithOptions(projectName: string, packageName: string, request: UpdatePackageRequest, headers: UpdatePackageHeaders, runtime: Util.RuntimeOptions): UpdatePackageResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.md5)) {
    body['md5'] = request.md5;
  }
  if (!Util.isUnset(request.originName)) {
    body['originName'] = request.originName;
  }
  if (!Util.isUnset(request.ossBucket)) {
    body['ossBucket'] = request.ossBucket;
  }
  if (!Util.isUnset(request.ossEndpoint)) {
    body['ossEndpoint'] = request.ossEndpoint;
  }
  if (!Util.isUnset(request.ossOwner)) {
    body['ossOwner'] = request.ossOwner;
  }
  if (!Util.isUnset(request.ossPath)) {
    body['ossPath'] = request.ossPath;
  }
  if (!Util.isUnset(request.tag)) {
    body['tag'] = request.tag;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdatePackage',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/packages/${OpenApiUtil.getEncodeParam(packageName)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updatePackage(projectName: string, packageName: string, request: UpdatePackageRequest): UpdatePackageResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new UpdatePackageHeaders{};
  return updatePackageWithOptions(projectName, packageName, request, headers, runtime);
}

model UpdateProjectHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId'),
}

model UpdateProjectRequest {
  globalJobConfig?: string(name='globalJobConfig'),
}

model UpdateProjectResponseBody = {
  requestId?: string(name='RequestId'),
}

model UpdateProjectResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateProjectResponseBody(name='body'),
}

async function updateProjectWithOptions(projectName: string, request: UpdateProjectRequest, headers: UpdateProjectHeaders, runtime: Util.RuntimeOptions): UpdateProjectResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.globalJobConfig)) {
    body['globalJobConfig'] = request.globalJobConfig;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateProject',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateProject(projectName: string, request: UpdateProjectRequest): UpdateProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new UpdateProjectHeaders{};
  return updateProjectWithOptions(projectName, request, headers, runtime);
}

model UpdateProjectConfigRequest {
  isOpenBatchSQL?: boolean(name='IsOpenBatchSQL'),
  projectName?: string(name='ProjectName'),
}

model UpdateProjectConfigResponseBody = {
  data?: boolean(name='Data'),
  requestId?: string(name='RequestId'),
}

model UpdateProjectConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateProjectConfigResponseBody(name='body'),
}

async function updateProjectConfigWithOptions(request: UpdateProjectConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProjectConfigResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.isOpenBatchSQL)) {
    query['IsOpenBatchSQL'] = request.isOpenBatchSQL;
  }
  if (!Util.isUnset(request.projectName)) {
    query['ProjectName'] = request.projectName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateProjectConfig',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/project/config`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateProjectConfig(request: UpdateProjectConfigRequest): UpdateProjectConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProjectConfigWithOptions(request, headers, runtime);
}

model UpdateQueueHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model UpdateQueueRequest {
  gpu?: int32(name='gpu', example='1'),
  maxMemMB?: int32(name='maxMemMB', example='16'),
  maxVcore?: int32(name='maxVcore', example='4'),
  queueName?: string(name='queueName', example='root.cloudpay_dev'),
}

model UpdateQueueResponseBody = {
  requestId?: string(name='RequestId', example='9F1CAD8D-E80E-45AF-82D7-8314FE17A34A'),
}

model UpdateQueueResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateQueueResponseBody(name='body'),
}

async function updateQueueWithOptions(clusterId: string, request: UpdateQueueRequest, headers: UpdateQueueHeaders, runtime: Util.RuntimeOptions): UpdateQueueResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.gpu)) {
    body['gpu'] = request.gpu;
  }
  if (!Util.isUnset(request.maxMemMB)) {
    body['maxMemMB'] = request.maxMemMB;
  }
  if (!Util.isUnset(request.maxVcore)) {
    body['maxVcore'] = request.maxVcore;
  }
  if (!Util.isUnset(request.queueName)) {
    body['queueName'] = request.queueName;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateQueue',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/clusters/${OpenApiUtil.getEncodeParam(clusterId)}/queue`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateQueue(clusterId: string, request: UpdateQueueRequest): UpdateQueueResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new UpdateQueueHeaders{};
  return updateQueueWithOptions(clusterId, request, headers, runtime);
}

model ValidateJobHeaders {
  commonHeaders?: map[string]string,
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model ValidateJobResponseBody = {
  jobInOut?: {
    dims?: {
      dim?: [ 
      {
        alias?: string(name='Alias', example='phoneNumber'),
        name?: string(name='Name', example='phoneNumber'),
        properties?: map[string]any(name='Properties', example='k:v'),
        type?: string(name='Type', example='rds'),
        workspace?: string(name='Workspace', example='project1'),
      }
    ](name='Dim')
    }(name='Dims'),
    inputs?: {
      input?: [ 
      {
        alias?: string(name='Alias', example='datahub_input1'),
        name?: string(name='Name', example='datahub_input1'),
        properties?: map[string]any(name='Properties', example='k:v'),
        type?: string(name='Type', example='datahub'),
        workspace?: string(name='Workspace', example='project1'),
      }
    ](name='Input')
    }(name='Inputs'),
    outputs?: {
      output?: [ 
      {
        alias?: string(name='Alias', example='result_infor'),
        name?: string(name='Name', example='result_infor'),
        properties?: map[string]any(name='Properties', example='k:v'),
        type?: string(name='Type', example='rds'),
        workspace?: string(name='Workspace', example='project1'),
      }
    ](name='Output')
    }(name='Outputs'),
  }(name='JobInOut'),
  requestId?: string(name='RequestId', example='5A3EB3CC-D899-4B0B-AF1F-1C0C0B6A0F91'),
}

model ValidateJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ValidateJobResponseBody(name='body'),
}

async function validateJobWithOptions(projectName: string, jobName: string, headers: ValidateJobHeaders, runtime: Util.RuntimeOptions): ValidateJobResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.regionId)) {
    realHeaders['RegionId'] = Util.toJSONString(headers.regionId);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  var params = new OpenApi.Params{
    action = 'ValidateJob',
    version = '2018-11-11',
    protocol = 'HTTPS',
    pathname = `/api/v2/projects/${OpenApiUtil.getEncodeParam(projectName)}/jobs/${OpenApiUtil.getEncodeParam(jobName)}/validate`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function validateJob(projectName: string, jobName: string): ValidateJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ValidateJobHeaders{};
  return validateJobWithOptions(projectName, jobName, headers, runtime);
}

